Commit ac851803 authored by hongguangwu's avatar hongguangwu

改密码

parent df027daf
...@@ -248,7 +248,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -248,7 +248,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#vo.userName") @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#vo.userName")
public R<String> updatePassword(UserPasswordVo vo) { public R<String> updatePassword(UserPasswordVo vo) {
SysUser sysUser = this.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUserId, vo.getUserId())); SysUser sysUser = this.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUserId, vo.getUserId()));
if (ENCODER.encode(vo.getOldPassword()).equals(sysUser.getPassword())) { if (ENCODER.matches(vo.getOldPassword(), sysUser.getPassword())) {
sysUser.setPassword(ENCODER.encode(vo.getNewPassword())); sysUser.setPassword(ENCODER.encode(vo.getNewPassword()));
} else { } else {
return R.failed("原密码错误"); return R.failed("原密码错误");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment