| | |
| | | if (BCrypt.checkpw(bo.getNewPassword(), password)) { |
| | | return R.fail("新密码不能与旧密码相同"); |
| | | } |
| | | |
| | | if (userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword())) > 0) { |
| | | int rows = DataPermissionHelper.ignore(() -> userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword()))); |
| | | if (rows > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改密码异常,请联系管理员"); |
| | |
| | | } |
| | | SysOssVo oss = ossService.upload(avatarfile); |
| | | String avatar = oss.getUrl(); |
| | | if (userService.updateUserAvatar(LoginHelper.getUserId(), oss.getOssId())) { |
| | | boolean updateSuccess = DataPermissionHelper.ignore(() -> userService.updateUserAvatar(LoginHelper.getUserId(), oss.getOssId())); |
| | | if (updateSuccess) { |
| | | AvatarVo avatarVo = new AvatarVo(); |
| | | avatarVo.setImgUrl(avatar); |
| | | return R.ok(avatarVo); |