提交 f59dec3a 编写于 作者: tony001's avatar tony001

修复菜单权限问题

上级 97f9827c
import { CtrlBase } from './CtrlBase'; import { CtrlBase } from './CtrlBase';
import { Emit } from 'vue-property-decorator'; import { Emit } from 'vue-property-decorator';
import { Environment } from '@/environments/environment';
/** /**
* 应用菜单基类 * 应用菜单基类
...@@ -137,9 +138,29 @@ export class AppMenusCtrlBase extends CtrlBase { ...@@ -137,9 +138,29 @@ export class AppMenusCtrlBase extends CtrlBase {
*/ */
public load(data: any) { public load(data: any) {
this.menus = this.menuModel.getAppMenuItems(); this.menus = this.menuModel.getAppMenuItems();
if(Environment.enablePermissionValid){
this.computedEffectiveMenus(this.menus);
}
this.menusChange(); this.menusChange();
} }
/**
* 计算有效菜单项
*
* @param {*} data
* @memberof Index
*/
public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{
if(!this.$store.getters['authresource/getAuthMenu'](_item)){
_item.hidden = true;
if (_item.items && _item.items.length > 0) {
this.computedEffectiveMenus(_item.items);
}
}
})
}
/** /**
* 菜单变更 * 菜单变更
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册