fix: 处理用户登录autoswitch
This commit is contained in:
parent
d95db82cee
commit
c262beb5a0
|
@ -808,7 +808,14 @@ public class UserService {
|
|||
}
|
||||
|
||||
private void autoSwitch(UserDTO user) {
|
||||
if (StringUtils.isEmpty(user.getLastProjectId())) {
|
||||
if (StringUtils.isNotBlank(user.getLastProjectId())) {
|
||||
List<UserGroup> projectUserGroups = user.getUserGroups().stream()
|
||||
.filter(ug -> StringUtils.equals(user.getLastProjectId(), ug.getSourceId()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(projectUserGroups)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
List<UserGroup> userGroups = user.getUserGroups();
|
||||
List<String> projectGroupIds = user.getGroups()
|
||||
.stream().filter(ug -> StringUtils.equals(ug.getType(), UserGroupType.PROJECT))
|
||||
|
@ -854,7 +861,7 @@ public class UserService {
|
|||
updateUser(user);
|
||||
SecurityUtils.getSubject().getSession().setAttribute(ATTR_USER, user);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<User> searchUser(String condition) {
|
||||
|
|
Loading…
Reference in New Issue