Compare commits
No commits in common. "78516474a1b72296307cbb701c203aee0034e4d7" and "7698f643a6f8b5760a94e51c385c61e25916d2eb" have entirely different histories.
78516474a1
...
7698f643a6
@ -46,7 +46,7 @@ public class AUserDetailsService implements UserDetailsService {
|
||||
userDto.setEnabled(true);
|
||||
userDto.setIsAdmin(false);
|
||||
// 创建一个 JwtCustomerDto 对象
|
||||
employeeDto = new JwtUserDto(userDto, UserTypeEnum.EMPLOYEES, new ArrayList<>(),null);
|
||||
employeeDto = new JwtUserDto(userDto, UserTypeEnum.EMPLOYEES, new ArrayList<>());
|
||||
// 添加缓存数据
|
||||
userCacheManager.addEmployeeCache(username, employeeDto);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class BUserDetailsService implements UserDetailsService {
|
||||
userDto.setEnabled(true);
|
||||
userDto.setIsAdmin(false);
|
||||
// 创建一个 JwtCustomerDto 对象
|
||||
customerDto = new JwtUserDto(userDto, UserTypeEnum.CUSTOMER, new ArrayList<>(), customerDto.getCustomerType());
|
||||
customerDto = new JwtUserDto(userDto, UserTypeEnum.CUSTOMER, new ArrayList<>());
|
||||
// 添加缓存数据
|
||||
userCacheManager.addCustomerCache(username, customerDto);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
// 获取用户的权限
|
||||
List<AuthorityDto> authorities = roleService.buildPermissions(user);
|
||||
// 初始化JwtUserDto
|
||||
jwtUserDto = new JwtUserDto(BeanUtil.copyProperties(user, LoginUserDto.class), UserTypeEnum.getByValue(user.getUserType()), authorities,null);
|
||||
jwtUserDto = new JwtUserDto(BeanUtil.copyProperties(user, LoginUserDto.class), UserTypeEnum.getByValue(user.getUserType()), authorities);
|
||||
// 添加缓存数据
|
||||
userCacheManager.addUserCache(username, jwtUserDto);
|
||||
}
|
||||
|
@ -50,9 +50,6 @@ public class JwtUserDto implements UserDetails {
|
||||
@ApiModelProperty(value = "角色")
|
||||
private final List<AuthorityDto> authorities;
|
||||
|
||||
@ApiModelProperty("客户类型")
|
||||
private final String customerType;
|
||||
|
||||
public Set<String> getRoles() {
|
||||
return authorities.stream().map(AuthorityDto::getAuthority).collect(Collectors.toSet());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user