|
|
|
@ -68,7 +68,7 @@ public class CommonController {
|
|
|
|
|
return new Result<>(401, "账号或者密码错误", "");
|
|
|
|
|
}
|
|
|
|
|
User user = optionalUser.get();
|
|
|
|
|
if(!Objects.equals(userLoginByAccountDTO.getMark(), user.getMark())) {
|
|
|
|
|
if (!Objects.equals(userLoginByAccountDTO.getMark(), user.getMark())) {
|
|
|
|
|
return new Result<>(401, "请选择正确身份", "");
|
|
|
|
|
}
|
|
|
|
|
if (user.getDisabled() == 1) {
|
|
|
|
@ -125,8 +125,8 @@ public class CommonController {
|
|
|
|
|
|
|
|
|
|
// 修改个人密码
|
|
|
|
|
@PutMapping("/rePassword")
|
|
|
|
|
public Result<String> modifyPassword(@RequestHeader("Authorization") String token,
|
|
|
|
|
@RequestBody @Validated @NotNull UserModifyPasswordDTO userModifyPasswordDTO) {
|
|
|
|
|
public Result<String> modifyPassword(
|
|
|
|
|
@RequestBody @Validated @NotNull UserModifyPasswordDTO userModifyPasswordDTO) {
|
|
|
|
|
// 判断密码
|
|
|
|
|
if (userModifyPasswordDTO.getOldPassword().equals(userModifyPasswordDTO.getNewPassword())) {
|
|
|
|
|
return new Result<>(409, "新密码不得和旧密码一致", "");
|
|
|
|
@ -142,8 +142,6 @@ public class CommonController {
|
|
|
|
|
user.setPassword(Md5Util.getMD5String(userModifyPasswordDTO.getNewPassword()));
|
|
|
|
|
user.setUpdateTime(null);
|
|
|
|
|
userService.updateById(user);
|
|
|
|
|
// 删除redis当中的token
|
|
|
|
|
stringRedisTemplate.delete(token);
|
|
|
|
|
// 删除当前线程的存储信息
|
|
|
|
|
ThreadLocalUtil.remove();
|
|
|
|
|
return new Result<>(200, "密码修改成功, 请重新登陆", "");
|
|
|
|
|