|
|
@ -52,11 +52,18 @@ public class UserController { |
|
|
|
return new Status(StateMessage.SUCCESS, "此id用户不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
//编辑 信息 |
|
|
|
UserDO userDO = MergeObjectsUtil.mergeObjects(request, userDetail); |
|
|
|
userService.updateUser(userDO); |
|
|
|
|
|
|
|
return new Status(StateMessage.SUCCESS, userDO); |
|
|
|
//有密码,覆盖密码,加密 |
|
|
|
if(request.getUserPassword()!=null && !"".equals(request.getUserPassword())){ |
|
|
|
userDetail.setUserPassword(request.getUserPassword()); |
|
|
|
UserDO userDO = MergeObjectsUtil.mergeObjects(request, userDetail); |
|
|
|
userService.updateUser(userDO); |
|
|
|
return new Status(StateMessage.SUCCESS, userDO); |
|
|
|
}else{ |
|
|
|
//没有密码,不重新加密 |
|
|
|
UserDO userDO = MergeObjectsUtil.mergeObjects(request, userDetail); |
|
|
|
userService.updateUserNoPassword(userDO); |
|
|
|
return new Status(StateMessage.SUCCESS, userDO); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//新增 |
|
|
|
|
|
|
|