fix(系统设置): 修复系统管理员默认组织项目切换错误问题

This commit is contained in:
fit2-zhao 2023-09-28 09:48:33 +08:00 committed by fit2-zhao
parent 05c863f62e
commit 685ca095d1
1 changed files with 1 additions and 2 deletions

View File

@ -265,6 +265,7 @@ public class BaseUserService {
if (StringUtils.equals("organization", sign)) {
user.setLastOrganizationId(sourceId);
sessionUser.setLastOrganizationId(sourceId);
user.setLastProjectId(StringUtils.EMPTY);
List<Project> projects = getProjectListByWsAndUserId(sessionUser.getId(), sourceId);
if (CollectionUtils.isNotEmpty(projects)) {
user.setLastProjectId(projects.get(0).getId());
@ -276,8 +277,6 @@ public class BaseUserService {
if (CollectionUtils.isNotEmpty(allWsProject)) {
user.setLastProjectId(allWsProject.get(0).getId());
}
} else {
user.setLastProjectId(StringUtils.EMPTY);
}
}
}