feat(role): 根据role判断用户的权限

This commit is contained in:
sophie committed 2026-09-18 09:21:04 +08:00
1 parent 80d78130f8
commit a24bd94d43
93 files changed
+4472 -387

No files matched your search

@@ -19,7 +19,7 @@ import { computed, defineAsyncComponent, provide, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { Maximize2, Minimize2, Loader2 } from 'lucide-vue-next';
import { useAuthStore } from '@/features/auth/stores/auth.store';
import ChatShell from '@/shared/layouts/ChatShell.vue';
@@ -164,7 +164,13 @@ const embeddedIframeSrc = computed(() => {
});
const canManageMaintenance = computed(() => ['admin', 'maintenance_manager'].includes(String(page.currentUser?.role || '')));
const authStore = useAuthStore();
/**
* 设备维保台账/维修写入口。
* 核心逻辑:读登录态 maintenance.ledger_write,不再认 role 字符串。
*/
const canManageMaintenance = computed(() => authStore.hasFeaturePermission('maintenance.ledger_write'));
const hideWelcomePanel = computed(() => false);