修复校验
This commit is contained in:
@@ -10,7 +10,7 @@ export function getPermList() {
|
||||
* 权限校验函数
|
||||
* @param perm 单个权限字符串 / 多个权限数组
|
||||
* @param mode or满足任一 / and全部满足,默认or
|
||||
* @returns 是否拥有权限
|
||||
* @returns 是否拥有权限 false 没有权限 true 有权限
|
||||
*/
|
||||
export function hasPermi(perm, mode = 'or') {
|
||||
const permList = getPermList()
|
||||
@@ -23,6 +23,7 @@ export function hasPermi(perm, mode = 'or') {
|
||||
// 所有权限都要有
|
||||
return checkArr.every(item => permList.includes(item))
|
||||
} else {
|
||||
console.log(permList, checkArr)
|
||||
// 有一个即可
|
||||
return checkArr.some(item => permList.includes(item))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user