用户管理

This commit is contained in:
lihongbiao 2025-07-19 21:34:47 +08:00
parent 254e0ac233
commit 041df2aebc
2 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
// emEmployees = emEmployeesService.findByUserId(user.getId());
// }
// 初始化JwtUserDto
jwtUserDto = new JwtUserDto(BeanUtil.copyProperties(user, LoginUserDto.class), UserTypeEnum.getByValue(user.getUserType()),dataService.getDeptIds(user), authorities,emEmployees);
jwtUserDto = new JwtUserDto(BeanUtil.copyProperties(user, LoginUserDto.class), UserTypeEnum.getByValue(user.getUserType()),null, authorities,emEmployees);
// 添加缓存数据
userCacheManager.addUserCache(username, jwtUserDto);
}

View File

@ -136,7 +136,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
if(!resources.getEnabled()){
onlineUserService.kickOutForUsername(resources.getUsername());
}
user.setPassword(passwordEncoder.encode(RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,resources.getPassword())));
if (resources.getPassword()!=null){
user.setPassword(passwordEncoder.encode(RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,resources.getPassword())));
}
user.setUsername(resources.getUsername());
user.setScenicId(resources.getScenicId());
user.setEnabled(resources.getEnabled());