|
|
@@ -74,12 +74,12 @@ public class UserAntiCorruptionImpl implements UserAntiCorruption {
|
|
|
throw new UserNotExistException();
|
|
|
log.info("userInfo: " + userInfo.toString());
|
|
|
try{
|
|
|
- //将用户中心的用户中心的用户数据对本系统内同步
|
|
|
- User newUser = userInfo.toUser();
|
|
|
+ //将用户中心的用户中心的用户数据对本系统内同步,直同步用户邮箱、手机号、密码
|
|
|
User oldUser = userRepo.getByID(userId);
|
|
|
- newUser.setRoleList(oldUser.getRoleList());
|
|
|
- newUser.setGender(oldUser.getGender());
|
|
|
- userRepo.saveUser(newUser);
|
|
|
+ oldUser.setEmail(userInfo.getEmail());
|
|
|
+ oldUser.setMobile(userInfo.getMobile());
|
|
|
+ oldUser.setPassword(userInfo.getPassword());
|
|
|
+ userRepo.saveUser(oldUser);
|
|
|
}catch (UserNotExistException e){ //本站不存在该用户,是未同步信息的新用户,初始化角色
|
|
|
User user = userInfo.toUser();
|
|
|
List<Role> roles = new ArrayList<>();
|