Commit d9895619 authored by Junling Bu's avatar Junling Bu
Browse files

chore[litemall-admin]: 权限校验支持超级权限*

parent 7ff545b1
......@@ -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)
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment