fix(系统设置): 新增工作空间后切换空的工作空间展示模块内容有误

This commit is contained in:
song-cc-rock 2023-09-27 15:59:04 +08:00 committed by fit2-zhao
parent 7f7afdc566
commit 4708d936cb
2 changed files with 8 additions and 1 deletions

View File

@ -143,7 +143,13 @@ export default {
return this.modules[key] === 'ENABLE';
}
let microApps = JSON.parse(sessionStorage.getItem("micro_apps"));
return this.modules[key] === 'ENABLE' && microApps && microApps[key];
if (sessionStorage.getItem("project_id") === 'no_such_project') {
// , ,
return (key === 'workstation' && microApps && microApps[key]) || (key === 'setting' && microApps && microApps[key]);
} else {
// ,
return this.modules[key] === 'ENABLE' && microApps && microApps[key];
}
},
getUiIndex() {
if (hasLicense()) {

View File

@ -246,6 +246,7 @@ public class BaseUserService {
if (StringUtils.equals("workspace", sign)) {
user.setLastWorkspaceId(sourceId);
sessionUser.setLastWorkspaceId(sourceId);
user.setLastProjectId(StringUtils.EMPTY);
List<Project> projects = getProjectListByWsAndUserId(sessionUser.getId(), sourceId);
if (CollectionUtils.isNotEmpty(projects)) {
user.setLastProjectId(projects.get(0).getId());