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