mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 18:40:22 +08:00
perf: 指令权限v-auth支持并显示按钮权限 (#3035)
This commit is contained in:
parent
d3fd22dbbd
commit
99ddc3598a
@ -75,6 +75,14 @@ export function usePermission() {
|
|||||||
if (PermissionModeEnum.BACK === permMode) {
|
if (PermissionModeEnum.BACK === permMode) {
|
||||||
const allCodeList = permissionStore.getPermCodeList as string[];
|
const allCodeList = permissionStore.getPermCodeList as string[];
|
||||||
if (!isArray(value)) {
|
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 allCodeList.includes(value);
|
||||||
}
|
}
|
||||||
return (intersection(value, allCodeList) as string[]).length > 0;
|
return (intersection(value, allCodeList) as string[]).length > 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user