修复校验

This commit is contained in:
Zy
2026-07-20 14:50:16 +08:00
parent d7c201d357
commit a5a883a652
8 changed files with 672 additions and 640 deletions

View File

@@ -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))
}