diff --git a/framework/sdk-parent/frontend/src/components/layout/AsideMenus.vue b/framework/sdk-parent/frontend/src/components/layout/AsideMenus.vue index 0afdca9e9d..b9edaefe06 100644 --- a/framework/sdk-parent/frontend/src/components/layout/AsideMenus.vue +++ b/framework/sdk-parent/frontend/src/components/layout/AsideMenus.vue @@ -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()) { diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseUserService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseUserService.java index 259fd622f3..2497c36384 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseUserService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseUserService.java @@ -246,6 +246,7 @@ public class BaseUserService { if (StringUtils.equals("workspace", sign)) { user.setLastWorkspaceId(sourceId); sessionUser.setLastWorkspaceId(sourceId); + user.setLastProjectId(StringUtils.EMPTY); List projects = getProjectListByWsAndUserId(sessionUser.getId(), sourceId); if (CollectionUtils.isNotEmpty(projects)) { user.setLastProjectId(projects.get(0).getId());