| | |
| | | public R<Void> updatePassword(@RequestBody UpdatePassword updatePassword) { |
| | | AppUser appLoginUser = SecurityUtils.getAppLoginUser(); |
| | | User user = userService.getById(appLoginUser.getUserId()); |
| | | String oldPassword = SecurityUtils.encryptPassword(updatePassword.getOldPassword()); |
| | | if (!user.getPassword().equals(oldPassword)) { |
| | | if (!SecurityUtils.matchesPassword(updatePassword.getOldPassword(), user.getPassword())) { |
| | | return R.fail("旧密码错误"); |
| | | } |
| | | if (!updatePassword.getNewPassword().equals(updatePassword.getConfirmPassword())){ |