user表role改为role_id;后台管理用户增删改查封装成component
This commit is contained in:
@@ -20,8 +20,9 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
const permiss = usePermissStore();
|
||||
app.directive('permiss', { // 元素级权限控制
|
||||
mounted(el, binding) {
|
||||
const role = localStorage.getItem('ms_role_id');
|
||||
if (!permiss[role as string] || !permiss[role as string].includes(binding.value as string)) {
|
||||
const roleId = localStorage.getItem('ms_role_id');
|
||||
const currentUserPermiss = permiss[roleId as string];
|
||||
if (!currentUserPermiss || !currentUserPermiss.includes(binding.value as string)) {
|
||||
el['hidden'] = true;
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user