Commit fba41708 authored by liqin's avatar liqin 💬

bug fixed

parent b3b7daaf
...@@ -72,6 +72,7 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -72,6 +72,7 @@ public class MyShiroRealm extends AuthorizingRealm {
/** /**
* 认证信息.(身份验证) : Authentication 是用来验证用户身份 * 认证信息.(身份验证) : Authentication 是用来验证用户身份
*
* @throws AuthenticationException * @throws AuthenticationException
*/ */
@Override @Override
...@@ -122,8 +123,8 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -122,8 +123,8 @@ public class MyShiroRealm extends AuthorizingRealm {
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
List<Role> list = roleService.selectRoleByUserId(userId); List<Role> list = roleService.selectRoleByUserId(userId);
List<String> ridList = new LinkedList<>(); List<String> ridList = new ArrayList<>();
if (list!=null&&list.get(0)!=null) { if (list != null && !list.isEmpty()) {
// // 根据用户ID查询角色(role),放入到Authorization里。 // // 根据用户ID查询角色(role),放入到Authorization里。
// Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
// map.put("user_id", userId); // map.put("user_id", userId);
...@@ -133,7 +134,7 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -133,7 +134,7 @@ public class MyShiroRealm extends AuthorizingRealm {
// ridList.add(employeeRole.getRoleId()); // ridList.add(employeeRole.getRoleId());
// } // }
// List<Role> roleList = this.roleService.listByIds(ridList); // List<Role> roleList = this.roleService.listByIds(ridList);
Set<String> roleSet = new HashSet<>(); Set<String> roleSet = new LinkedHashSet<>();
for (Role role : list) { for (Role role : list) {
roleSet.add(role.getAlias()); roleSet.add(role.getAlias());
ridList.add(role.getId()); 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