From 57ab87688694472c9dc74587fd2396793cf023ef Mon Sep 17 00:00:00 2001 From: ZG4vin Date: Thu, 24 Oct 2024 17:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=9A=84=E8=A7=92=E8=89=B2code=E7=94=B1admin=E6=94=B9?= =?UTF-8?q?=E4=B8=BAsuper=5Fadmin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/directives/permission/hasRole.ts | 2 +- src/utils/permission.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)