fix: 用户修改last_workspace_id之后执行登录被覆盖的问题
This commit is contained in:
parent
b7f165c9ce
commit
72bb76e5e4
|
@ -632,6 +632,7 @@ public class UserService {
|
|||
}
|
||||
|
||||
private void autoSwitch(UserDTO user) {
|
||||
// 用户有 last_project_id 权限
|
||||
if (StringUtils.isNotBlank(user.getLastProjectId())) {
|
||||
List<UserGroup> projectUserGroups = user.getUserGroups().stream()
|
||||
.filter(ug -> StringUtils.equals(user.getLastProjectId(), ug.getSourceId()))
|
||||
|
@ -640,6 +641,15 @@ public class UserService {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// 用户有 last_workspace_id 权限
|
||||
if (StringUtils.isNotBlank(user.getLastWorkspaceId())) {
|
||||
List<UserGroup> workspaceUserGroups = user.getUserGroups().stream()
|
||||
.filter(ug -> StringUtils.equals(user.getLastWorkspaceId(), ug.getSourceId()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(workspaceUserGroups)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
List<UserGroup> userGroups = user.getUserGroups();
|
||||
List<String> projectGroupIds = user.getGroups()
|
||||
.stream().filter(ug -> StringUtils.equals(ug.getType(), UserGroupType.PROJECT))
|
||||
|
|
Loading…
Reference in New Issue