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