fetch(modify):修改bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m20s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m20s
This commit is contained in:
@@ -22,16 +22,20 @@ const permissionDirective: Directive = {
|
||||
let hasPermission = false
|
||||
|
||||
if (typeof value === 'string') {
|
||||
// 单个权限
|
||||
hasPermission = userStore.hasPermission(value)
|
||||
// 单个权限(同时检查 permissions 和 buttons)
|
||||
hasPermission = userStore.hasPermission(value) || userStore.hasButton(value)
|
||||
} else if (Array.isArray(value)) {
|
||||
// 多个权限
|
||||
if (arg === 'all') {
|
||||
// 需要全部满足
|
||||
hasPermission = userStore.hasAllPermissions(value)
|
||||
hasPermission = value.every(
|
||||
(perm) => userStore.hasPermission(perm) || userStore.hasButton(perm)
|
||||
)
|
||||
} else {
|
||||
// 满足任意一个即可
|
||||
hasPermission = userStore.hasAnyPermission(value)
|
||||
hasPermission = value.some(
|
||||
(perm) => userStore.hasPermission(perm) || userStore.hasButton(perm)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user