mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 10:56:39 +08:00
更正前端权限插件的判断
This commit is contained in:
parent
9a6d758fc7
commit
2c70db1498
@ -21,7 +21,7 @@ export function privilegeDirective(el, binding) {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
// 如果没有权限,删除节点
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import _ from 'lodash';
|
||||
|
||||
const privilege = (value) => {
|
||||
// 超级管理员
|
||||
@ -19,7 +20,7 @@ const privilege = (value) => {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
return userPointsList && userPointsList.includes(value);
|
||||
return _.some(userPointsList, ['apiPerms', value]);
|
||||
};
|
||||
|
||||
export default {
|
||||
|
@ -21,7 +21,7 @@ export function privilegeDirective(el: { parentNode: { removeChild: (arg0: any)
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
// 如果没有权限,删除节点
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { App } from 'vue';
|
||||
import _ from 'lodash';
|
||||
|
||||
const privilege = (value: string) => {
|
||||
// 超级管理员
|
||||
@ -20,7 +21,7 @@ const privilege = (value: string) => {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
return userPointsList && userPointsList.includes(value);
|
||||
return _.some(userPointsList, ['apiPerms', value]);
|
||||
};
|
||||
|
||||
export default {
|
||||
|
Loading…
Reference in New Issue
Block a user