Skip to content

Commit

Permalink
上下文添加用户角色.
Browse files Browse the repository at this point in the history
  • Loading branch information
magestacks committed Dec 12, 2021
1 parent 4e2f79d commit 4e2a03f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private UsernamePasswordAuthenticationToken getAuthentication(String tokenHeader
}

String username = JwtTokenUtil.getUsername(token);
UserContext.setUserName(username);
String userRole = JwtTokenUtil.getUserRole(token);
UserContext.setUserInfo(username, userRole);

String role = JwtTokenUtil.getUserRole(token);
if (username != null) {
Expand Down

0 comments on commit 4e2a03f

Please sign in to comment.