|
|
|
|
@ -103,8 +103,8 @@ public class SysProfileController extends BaseController {
|
|
|
|
|
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("修改密码异常,请联系管理员");
|
|
|
|
|
@ -127,7 +127,8 @@ public class SysProfileController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
RemoteFile oss = remoteFileService.upload(avatarfile.getName(), avatarfile.getOriginalFilename(), avatarfile.getContentType(), avatarfile.getBytes());
|
|
|
|
|
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);
|
|
|
|
|
|