feat(role): 根据role判断用户的权限
This commit is contained in:
1 parent
80d78130f8
commit
a24bd94d43
93 files changed
+4472
-387
No files matched your search
@@ -7,7 +7,7 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { getStoredAuthUser } from '@/shared/utils/auth';
|
||||
import { getStoredAuthUser, isPlatformAdminUser } from '@/shared/utils/auth';
|
||||
import type {
|
||||
KbDocumentItem,
|
||||
KbJob,
|
||||
@@ -30,9 +30,7 @@ export function createKbWorkspaceState(options: CreateKbWorkspaceStateOptions =
|
||||
const router = useRouter();
|
||||
const { t } = useI18n({ useScope: 'global' });
|
||||
|
||||
const isKbAdmin = computed(
|
||||
() => String(getStoredAuthUser()?.role || '').trim().toLowerCase() === 'admin',
|
||||
);
|
||||
const isKbAdmin = computed(() => isPlatformAdminUser(getStoredAuthUser()));
|
||||
|
||||
const isLoading = ref(true);
|
||||
const isDocumentsLoading = ref(false);
|
||||
|
||||
Reference in new issue
Block a user