| | |
| | | if (r.getData() == null) { |
| | | throw new ServiceException("账号不存在"); |
| | | } |
| | | if (!SecurityUtils.matchesPassword(r.getData().getPassword(), password)) { |
| | | if (!SecurityUtils.matchesPassword(password, r.getData().getPassword())) { |
| | | throw new ServiceException("密码错误"); |
| | | } |
| | | return r.getData(); |
| | |
| | | if (Objects.isNull(sysUser)){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | if (!SecurityUtils.matchesPassword(SecurityUtils.encryptPassword(dto.getOldPassword()), sysUser.getPassword())){ |
| | | if (!SecurityUtils.matchesPassword(dto.getOldPassword(), sysUser.getPassword())){ |
| | | throw new ServiceException("原密码错误"); |
| | | } |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(dto.getNewPassword())); |