Fix:用户修改邮箱失败的问题

close https://github.com/elunez/eladmin-mp/issues/36
This commit is contained in:
Zheng Jie 2024-08-02 17:28:15 +08:00
parent 85486d12f7
commit beb9b0ee82

View File

@ -189,8 +189,8 @@ public class UserController {
if(!passwordEncoder.matches(password, user.getPassword())){
throw new BadRequestException("密码错误");
}
verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + user.getEmail(), code);
userService.updateEmail(user.getUsername(),user.getEmail());
verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + resources.getEmail(), code);
userService.updateEmail(user.getUsername(),resources.getEmail());
return new ResponseEntity<>(HttpStatus.OK);
}