权限相关调整

This commit is contained in:
fuenmao
2026-09-10 16:43:23 +08:00
parent 0db1848b10
commit 4371eca6c4
11 changed files with 347 additions and 36 deletions
+3
View File
@@ -13,6 +13,7 @@
* @see https://gitee.com/dotnetmoyu/SimpleAdmin
*/
import { useAuthStore } from "@/stores/modules/auth";
import { useUserStore } from "@/stores/modules/user";
import type { Directive, DirectiveBinding } from "vue";
/**
@@ -32,6 +33,8 @@ const auth: Directive = {
const { value, arg } = binding;
// 获取authStore
const authStore = useAuthStore();
const userStore = useUserStore();
if ((userStore.userInfoGet?.roleCodeList || []).includes("superAdmin")) return;
// 获取用户权限按钮列表
const currentPageRoles = authStore.authButtonListGet ?? [];
// 如果传入的值是数组,并且数组的长度大于0