Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
92f4160f
authored
Oct 27, 2024
by
芋道源码
Committed by
Gitee
Oct 27, 2024
Browse files
Options
Browse Files
Download
Plain Diff
!572 修复:将超级管理员的角色code由admin改为super_admin
Merge pull request !572 from ZG4vin/master
parents
c1a22280
57ab8768
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/directives/permission/hasRole.ts
+1
-1
src/utils/permission.ts
+1
-1
No files found.
src/directives/permission/hasRole.ts
View file @
92f4160f
...
...
@@ -7,7 +7,7 @@ export function hasRole(app: App<Element>) {
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
)
{
...
...
src/utils/permission.ts
View file @
92f4160f
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment