Skip to content

Commit

Permalink
fix: 在请求中保存用户信息到 httpsession 修复issue:#7141 (#7252)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterChangRay authored Nov 24, 2021
1 parent e5cb831 commit d05dff5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static String getAppName(HttpServletRequest request) {
* @return may be return null
*/
public static User getUser(HttpServletRequest request) {
Object userObj = request.getAttribute(NACOS_USER_KEY);
Object userObj = request.getSession().getAttribute(NACOS_USER_KEY);
if (userObj == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public User login(Object request) throws AccessException {
}
}
}
req.setAttribute(RequestUtil.NACOS_USER_KEY, user);
req.getSession().setAttribute(RequestUtil.NACOS_USER_KEY, user);
return user;
}

Expand Down

0 comments on commit d05dff5

Please sign in to comment.