luchanan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
0 deletions
-
src/hooks/web/usePermission.ts
|
|
|
@ -75,6 +75,14 @@ export function usePermission() { |
|
|
|
if (PermissionModeEnum.BACK === permMode) { |
|
|
|
const allCodeList = permissionStore.getPermCodeList as string[]; |
|
|
|
if (!isArray(value)) { |
|
|
|
const splits = ['||', '&&']; |
|
|
|
const splitName = splits.find((item) => value.includes(item)); |
|
|
|
if (splitName) { |
|
|
|
const splitCodes = value.split(splitName); |
|
|
|
return splitName === splits[0] |
|
|
|
? intersection(splitCodes, allCodeList).length > 0 |
|
|
|
: intersection(splitCodes, allCodeList).length === splitCodes.length; |
|
|
|
} |
|
|
|
return allCodeList.includes(value); |
|
|
|
} |
|
|
|
return (intersection(value, allCodeList) as string[]).length > 0; |
|
|
|
|