Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
fba41708
Commit
fba41708
authored
Mar 28, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
b3b7daaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
MyShiroRealm.java
...cn/wisenergy/chnmuseum/party/auth/realm/MyShiroRealm.java
+4
-3
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/auth/realm/MyShiroRealm.java
View file @
fba41708
...
...
@@ -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
Linked
List
<>();
if
(
list
!=
null
&&
list
.
get
(
0
)!=
null
)
{
List
<
String
>
ridList
=
new
Array
List
<>();
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
Linked
HashSet
<>();
for
(
Role
role
:
list
)
{
roleSet
.
add
(
role
.
getAlias
());
ridList
.
add
(
role
.
getId
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment