diff --git a/src/directives/permission/hasRole.ts b/src/directives/permission/hasRole.ts index 31a352a7..a5de2b8d 100644 --- a/src/directives/permission/hasRole.ts +++ b/src/directives/permission/hasRole.ts @@ -7,7 +7,7 @@ export function hasRole(app: App) { app.directive('hasRole', (el, binding) => { const { wsCache } = useCache() const { value } = binding - const super_admin = 'admin' + const super_admin = 'super_admin' const roles = wsCache.get(CACHE_KEY.USER).roles if (value && value instanceof Array && value.length > 0) { diff --git a/src/utils/permission.ts b/src/utils/permission.ts index a63ee628..f6077d1a 100644 --- a/src/utils/permission.ts +++ b/src/utils/permission.ts @@ -32,7 +32,7 @@ export function checkRole(value: string[]) { if (value && value instanceof Array && value.length > 0) { const { wsCache } = useCache() const permissionRoles = value - const super_admin = 'admin' + const super_admin = 'super_admin' const roles = wsCache.get(CACHE_KEY.USER).roles const hasRole = roles.some((role) => { return super_admin === role || permissionRoles.includes(role)