|
|
@@ -50,19 +50,19 @@ public class SysLoginController {
|
|
|
|
|
|
@ApiOperation("修改密码")
|
|
|
@PostMapping(value = "/updatePass")
|
|
|
- public ResponseEntity<Object> updatePass(@RequestBody @Validated UserPassVo passVo) throws Exception {
|
|
|
+ public R<Boolean> updatePass(@RequestBody @Validated UserPassVo passVo) throws Exception {
|
|
|
// 密码解密
|
|
|
Long userId = SecurityUtil.getSysUser().getId();
|
|
|
SysUser sysUser = sysUserService.getById(userId);
|
|
|
if (!SecurityUtil.matchesPassword(passVo.getOldPass(), sysUser.getPassword())) {
|
|
|
throw new CustomException("旧密码不正确");
|
|
|
}
|
|
|
- String encryptPassword = SecurityUtil.encryptPassword(sysUser.getPassword());
|
|
|
+ String encryptPassword = SecurityUtil.encryptPassword(passVo.getNewPass());
|
|
|
sysUserService
|
|
|
.update(new UpdateWrapper<SysUser>()
|
|
|
.lambda().eq(SysUser::getId,userId)
|
|
|
.set(SysUser::getPassword,encryptPassword));
|
|
|
- return new ResponseEntity<>(HttpStatus.OK);
|
|
|
+ return R.success(true);
|
|
|
}
|
|
|
@Log(title = "获取用户信息")
|
|
|
@GetMapping("/getUserInfo")
|