提交 4bdaf214 authored 作者: gongwenjie's avatar gongwenjie

接口注释,人员部分代码

上级 e79d0035
......@@ -49,20 +49,25 @@ public class MyUserDetailsServiceImpl implements UserDetailsService {
if(user!=null){
List<UserRole> userRoles = userRoleDao.findAllByUserId(user.getId());
List<String> roleIds = new ArrayList<>();
if(userRoles!=null){
for (UserRole userRole : userRoles) {
roleIds.add(userRole.getRoleId());
}
}
user.setUsername(username);
user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));
ArrayList<SimpleGrantedAuthority> list = new ArrayList<>();
List<Role> roles = roleDao.findAllByIdIn(roleIds);
List<RoleAuthority> roleAuthorities = roleAuthorityDao.findAllByRoleIdIn(roleIds);
List<String> authorityIds = new ArrayList<>();
if(roleAuthorities!=null){
for (RoleAuthority roleAuthority : roleAuthorities) {
if(!authorityIds.contains(roleAuthority.getAuthorityId())){
authorityIds.add(roleAuthority.getAuthorityId());
}
}
}
List<Authority> authorities = authorityDao.findAllByIdIn(authorityIds);
authorities.forEach(authority -> {
list.add(new SimpleGrantedAuthority(authority.getName()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论