import { computed } from "vue";
|
|
import { useAuthStore } from "@/stores/modules/auth"; // 根据实际情况修改导入路径
|
|
export const useAuthButtons = () => {
|
// 原本获取当前路由信息的代码保留,但后续不再使用
|
// const route = useRoute();
|
const authStore = useAuthStore();
|
|
// 获取 authButtonListGet 对象中的所有值,并将它们合并成一个数组
|
const allAuthButtons = Object.values(authStore.authButtonListGet).flat();
|
|
const BUTTONS = computed(() => {
|
let currentPageAuthButton = {};
|
allAuthButtons.forEach(item => (currentPageAuthButton[item] = true));
|
return currentPageAuthButton;
|
});
|
|
return {
|
BUTTONS
|
};
|
};
|