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
Litemall
Commits
d9895619
Commit
d9895619
authored
Feb 10, 2019
by
Junling Bu
Browse files
chore[litemall-admin]: 权限校验支持超级权限*
parent
7ff545b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-admin/src/directive/permission/permission.js
View file @
d9895619
...
...
@@ -9,9 +9,15 @@ export default{
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
const
permissions
=
value
const
hasPermission
=
perms
.
some
(
perm
=>
{
return
permissions
.
includes
(
perm
)
})
var
hasPermission
=
false
if
(
perms
.
indexOf
(
'
*
'
)
>=
0
)
{
hasPermission
=
true
}
else
{
hasPermission
=
perms
.
some
(
perm
=>
{
return
permissions
.
includes
(
perm
)
})
}
if
(
!
hasPermission
)
{
el
.
parentNode
&&
el
.
parentNode
.
removeChild
(
el
)
...
...
litemall-admin/src/utils/permission.js
View file @
d9895619
...
...
@@ -10,9 +10,15 @@ export default function checkPermission(value) {
const
perms
=
store
.
getters
&&
store
.
getters
.
perms
const
permissions
=
value
const
hasPermission
=
perms
.
some
(
perm
=>
{
return
permissions
.
includes
(
perm
)
})
var
hasPermission
=
false
if
(
perms
.
indexOf
(
'
*
'
)
>=
0
)
{
hasPermission
=
true
}
else
{
hasPermission
=
perms
.
some
(
perm
=>
{
return
permissions
.
includes
(
perm
)
})
}
if
(
!
hasPermission
)
{
return
false
...
...
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