!481 fix bug 多角色 无法更新个人信息

Merge pull request !481 from Dionys/jdk17
This commit is contained in:
lbw 2024-03-19 07:53:15 +00:00 committed by Gitee
commit a00e3468ea
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -204,7 +204,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override @Override
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username") @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
public R<Boolean> updateUserInfo(UserDTO userDto) { public R<Boolean> updateUserInfo(UserDTO userDto) {
UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername()); UserVO userVO = baseMapper.getUserVoById(SecurityUtils.getUser().getId());
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
sysUser.setPhone(userDto.getPhone()); sysUser.setPhone(userDto.getPhone());
@ -412,7 +412,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override @Override
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username") @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
public R changePassword(UserDTO userDto) { public R changePassword(UserDTO userDto) {
UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername()); UserVO userVO = baseMapper.getUserVoById(SecurityUtils.getUser().getId());
if (Objects.isNull(userVO)) { if (Objects.isNull(userVO)) {
return R.failed("用户不存在"); return R.failed("用户不存在");
} }