This commit is contained in:
“zhuoda
2019-11-16 18:17:31 +08:00
parent c24e89a503
commit 3d34508478
604 changed files with 51535 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
// 页面内按钮过滤
import store from '@/store/index';
export default {
inserted: function (el, binding, vnode) {
// 获取当前路由name
// 如果页面为同一模块下的子页面则取最上级权限
let routeName = vnode.context.$route.meta.group
? vnode.context.$route.meta.group
: vnode.context.$route.name;
// 超级管理员
if (store.state.user.userLoginInfo.isSuperMan) {
return true;
}
// 获取功能点权限
let functionList = store.state.user.privilegeFunctionPointsMap.get(routeName);
// 有权限
if (functionList && functionList.includes(binding.value)) {
} else {
el.parentNode.removeChild(el);
}
}
};