mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 21:53:48 +08:00
2.0的js版本和后端 完成
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 权限
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:00:40
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
|
||||
|
||||
// 页面内按钮过滤
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import lodash from 'lodash';
|
||||
|
||||
export function privilegeDirective(el, binding) {
|
||||
// 超级管理员
|
||||
if (useUserStore().administratorFlag) {
|
||||
return true;
|
||||
}
|
||||
// 获取功能点权限
|
||||
let userPointsList = useUserStore().getPointList;
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
if (!lodash.some(userPointsList,['webPerms',binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user