|
@@ -7,7 +7,7 @@ const PermissionDirective: Directive = { // 数组, 权限 code 和 布尔值
|
|
// mounted(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
|
|
// mounted(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
|
|
updated(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
|
|
updated(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
|
|
const routePath: string = vnode.ctx.appContext.config.globalProperties.$route.path;
|
|
const routePath: string = vnode.ctx.appContext.config.globalProperties.$route.path;
|
|
- const userInfo: { userInfo: { functionList: { code: string }[] } } | null = JSON.parse(localStorage.getItem('storeInfo') || '');
|
|
|
|
|
|
+ const userInfo: { userInfo: { functionList: { code: string }[] } } | null = JSON.parse(sessionStorage.getItem('storeInfo') || '');
|
|
const authorityCodes: string[] = (userInfo?.userInfo?.functionList || []).map(({ code }) => code);
|
|
const authorityCodes: string[] = (userInfo?.userInfo?.functionList || []).map(({ code }) => code);
|
|
const permissions: (string | boolean)[] = binding.value;
|
|
const permissions: (string | boolean)[] = binding.value;
|
|
const hasPermission: any[] = (binding.value || []).filter(item => typeof item !== 'boolean');
|
|
const hasPermission: any[] = (binding.value || []).filter(item => typeof item !== 'boolean');
|