chore[litemall-admin]: 权限校验支持超级权限*
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user