|
|
@@ -179,6 +179,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
return Boolean.TRUE;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
|
|
|
public R<Boolean> updateUserInfo(UserDTO userDto) {
|
|
|
@@ -221,13 +222,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
|
|
|
/**
|
|
|
* 锁定用户
|
|
|
- * @param username 用户名
|
|
|
+ * @param user 用户
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#username")
|
|
|
- public R<Boolean> lockUser(String username) {
|
|
|
- SysUser sysUser = baseMapper.selectOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUsername, username));
|
|
|
+ @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#user.username")
|
|
|
+ public R<Boolean> lockUser(SysUser user) {
|
|
|
+ SysUser sysUser = baseMapper.selectOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUserId, user.getUserId()));
|
|
|
|
|
|
if (Objects.nonNull(sysUser)) {
|
|
|
sysUser.setLockFlag(CommonConstants.STATUS_LOCK);
|
|
|
@@ -253,10 +254,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
return R.failed(ErrorTypeEnum.SYS_USER_UPDATE_PASSWORD_ERROR);
|
|
|
}
|
|
|
|
|
|
- if (StrUtil.isEmpty(userDto.getNewpassword1())) {
|
|
|
+ if (StrUtil.isEmpty(userDto.getNewPwd())) {
|
|
|
return R.failed("新密码不能为空");
|
|
|
}
|
|
|
- String password = ENCODER.encode(userDto.getNewpassword1());
|
|
|
+ String password = ENCODER.encode(userDto.getNewPwd());
|
|
|
|
|
|
this.update(Wrappers.<SysUser>lambdaUpdate()
|
|
|
.set(SysUser::getPassword, password)
|