|
|
@@ -9,12 +9,12 @@ function hasPermissionDirective(el, binding) {
|
|
|
}
|
|
|
|
|
|
// 尝试解析用户权限
|
|
|
- const userPermissions = localST_UserInfo.getItem();
|
|
|
+ const user_permissions = localST_UserInfo.getItem();
|
|
|
if (typeof userPermissions !== 'string') {
|
|
|
console.error('用户权限不是字符串格式');
|
|
|
return;
|
|
|
}
|
|
|
- const permissions = JSON.parse(userPermissions);
|
|
|
+ const permissions = JSON.parse(user_permissions);
|
|
|
|
|
|
// 确保 permissions 是数组类型
|
|
|
if (!Array.isArray(permissions)) {
|
|
|
@@ -23,14 +23,14 @@ function hasPermissionDirective(el, binding) {
|
|
|
}
|
|
|
|
|
|
// 获取按钮权限
|
|
|
- const btnPermission = binding.value;
|
|
|
- if (btnPermission === undefined) {
|
|
|
+ const btn_permission = binding.value;
|
|
|
+ if (btn_permission === undefined) {
|
|
|
console.error('按钮权限未定义');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 检查权限
|
|
|
- if (!permissions.includes('*:*:*') && !permissions.includes(btnPermission)) {
|
|
|
+ if (!permissions.includes('*:*:*') && !permissions.includes(btn_permission)) {
|
|
|
el.style.display = 'none';
|
|
|
}
|
|
|
} catch (error) {
|