Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
3c4b01ab
Commit
3c4b01ab
authored
Dec 21, 2020
by
DokiYoloo
Committed by
Gitee
Dec 21, 2020
Browse files
权限工具类增加admin判断
parent
52264b6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-ui/src/utils/permission.js
View file @
3c4b01ab
...
...
@@ -9,9 +9,10 @@ export function checkPermi(value) {
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
const
permissions
=
store
.
getters
&&
store
.
getters
.
permissions
const
permissionDatas
=
value
const
all_permission
=
"
*:*:*
"
;
const
hasPermission
=
permissions
.
some
(
permission
=>
{
return
permissionDatas
.
includes
(
permission
)
return
all_permission
===
permission
||
permissionDatas
.
includes
(
permission
)
})
if
(
!
hasPermission
)
{
...
...
@@ -33,9 +34,10 @@ export function checkRole(value) {
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
const
roles
=
store
.
getters
&&
store
.
getters
.
roles
const
permissionRoles
=
value
const
super_admin
=
"
admin
"
;
const
hasRole
=
roles
.
some
(
role
=>
{
return
permissionRoles
.
includes
(
role
)
return
super_admin
===
role
||
permissionRoles
.
includes
(
role
)
})
if
(
!
hasRole
)
{
...
...
Write
Preview
Supports
Markdown
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