Commit 57ab8768 by ZG4vin

将超级管理员的角色code由admin改为super_admin

parent a31bafbb
...@@ -7,7 +7,7 @@ export function hasRole(app: App<Element>) { ...@@ -7,7 +7,7 @@ export function hasRole(app: App<Element>) {
app.directive('hasRole', (el, binding) => { app.directive('hasRole', (el, binding) => {
const { wsCache } = useCache() const { wsCache } = useCache()
const { value } = binding const { value } = binding
const super_admin = 'admin' const super_admin = 'super_admin'
const roles = wsCache.get(CACHE_KEY.USER).roles const roles = wsCache.get(CACHE_KEY.USER).roles
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
......
...@@ -32,7 +32,7 @@ export function checkRole(value: string[]) { ...@@ -32,7 +32,7 @@ export function checkRole(value: string[]) {
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
const { wsCache } = useCache() const { wsCache } = useCache()
const permissionRoles = value const permissionRoles = value
const super_admin = 'admin' const super_admin = 'super_admin'
const roles = wsCache.get(CACHE_KEY.USER).roles const roles = wsCache.get(CACHE_KEY.USER).roles
const hasRole = roles.some((role) => { const hasRole = roles.some((role) => {
return super_admin === role || permissionRoles.includes(role) return super_admin === role || permissionRoles.includes(role)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment