📅  最后修改于: 2022-03-11 14:52:49.945000             🧑  作者: Mango
private Set getAuthority(User user) {
Set authorities = new HashSet<>();
user.getRoles().forEach(role -> {
authorities.add(new SimpleGrantedAuthority("ROLE_" + role.getName()));
});
return authorities;
}