fix(系统设置): LDAP用户首次登录后菜单显示问题

--bug=1018387 --user=李玉号
【系统设置】LDAP用户首次登录系统失败,再次登录成,但是页面显示需要优化
https://www.tapd.cn/55049933/s/1267896
This commit is contained in:
shiziyuan9527 2022-10-19 17:30:33 +08:00 committed by lyh
parent 111505f77d
commit ae23e35fb2
1 changed files with 23 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<ms-container :is-show-warning="isShowWarning && isSystemGroup"> <ms-container :is-show-warning="isShowWarning && isSystemGroup">
<ms-aside-container> <ms-aside-container :enable-aside-hidden="enableAsideHidden" :width="enableAsideHidden ? '300px' : '0px'">
<ms-setting-menu/> <ms-setting-menu/>
</ms-aside-container> </ms-aside-container>
<ms-main-container> <ms-main-container>
@ -23,6 +23,7 @@ import MsMainContainer from "metersphere-frontend/src/components/MsMainContainer
import {getCurrentUser} from "metersphere-frontend/src/utils/token"; import {getCurrentUser} from "metersphere-frontend/src/utils/token";
import {GROUP_SYSTEM} from "metersphere-frontend/src/utils/constants"; import {GROUP_SYSTEM} from "metersphere-frontend/src/utils/constants";
import MsHeaderRightMenus from "metersphere-frontend/src/components/layout/HeaderRightMenus"; import MsHeaderRightMenus from "metersphere-frontend/src/components/layout/HeaderRightMenus";
import {hasPermissions} from "metersphere-frontend/src/utils/permission";
export default { export default {
@ -30,7 +31,6 @@ export default {
components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser, MsHeaderRightMenus}, components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser, MsHeaderRightMenus},
computed: { computed: {
isShowWarning() { isShowWarning() {
// return this.$store.state.showLicenseCountWarning;
return false; return false;
}, },
isSystemGroup() { isSystemGroup() {
@ -40,6 +40,27 @@ export default {
return group.length > 0; return group.length > 0;
} }
return false; return false;
},
enableAsideHidden() {
let systemPermission = [
'SYSTEM_USER:READ',
'SYSTEM_ORGANIZATION:READ',
'SYSTEM_GROUP:READ',
'SYSTEM_WORKSPACE:READ',
'SYSTEM_TEST_POOL:READ',
'SYSTEM_SETTING:READ',
'SYSTEM_QUOTA:READ',
'SYSTEM_AUTH:READ'
];
let workspacePermission = [
'WORKSPACE_USER:READ',
'WORKSPACE_SERVICE:READ',
'WORKSPACE_PROJECT_MANAGER:READ',
'WORKSPACE_PROJECT_ENVIRONMENT:READ',
'WORKSPACE_OPERATING_LOG:READ'
];
return hasPermissions(...systemPermission)
|| hasPermissions(...workspacePermission);
} }
} }
}; };