Skip to content

Commit 92f4160

Browse files
YunaiVgitee-org
authored andcommitted
!572 修复:将超级管理员的角色code由admin改为super_admin
Merge pull request !572 from ZG4vin/master
2 parents c1a2228 + 57ab876 commit 92f4160

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/directives/permission/hasRole.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function hasRole(app: App<Element>) {
77
app.directive('hasRole', (el, binding) => {
88
const { wsCache } = useCache()
99
const { value } = binding
10-
const super_admin = 'admin'
10+
const super_admin = 'super_admin'
1111
const roles = wsCache.get(CACHE_KEY.USER).roles
1212

1313
if (value && value instanceof Array && value.length > 0) {

src/utils/permission.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function checkRole(value: string[]) {
3232
if (value && value instanceof Array && value.length > 0) {
3333
const { wsCache } = useCache()
3434
const permissionRoles = value
35-
const super_admin = 'admin'
35+
const super_admin = 'super_admin'
3636
const roles = wsCache.get(CACHE_KEY.USER).roles
3737
const hasRole = roles.some((role) => {
3838
return super_admin === role || permissionRoles.includes(role)

0 commit comments

Comments
 (0)