Commit fba41708 authored by liqin's avatar liqin 💬

bug fixed

parent b3b7daaf
......@@ -72,6 +72,7 @@ public class MyShiroRealm extends AuthorizingRealm {
/**
* 认证信息.(身份验证) : Authentication 是用来验证用户身份
*
* @throws AuthenticationException
*/
@Override
......@@ -122,8 +123,8 @@ public class MyShiroRealm extends AuthorizingRealm {
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
List<Role> list = roleService.selectRoleByUserId(userId);
List<String> ridList = new LinkedList<>();
if (list!=null&&list.get(0)!=null) {
List<String> ridList = new ArrayList<>();
if (list != null && !list.isEmpty()) {
// // 根据用户ID查询角色(role),放入到Authorization里。
// Map<String, Object> map = new HashMap<>();
// map.put("user_id", userId);
......@@ -133,7 +134,7 @@ public class MyShiroRealm extends AuthorizingRealm {
// ridList.add(employeeRole.getRoleId());
// }
// List<Role> roleList = this.roleService.listByIds(ridList);
Set<String> roleSet = new HashSet<>();
Set<String> roleSet = new LinkedHashSet<>();
for (Role role : list) {
roleSet.add(role.getAlias());
ridList.add(role.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment