Skip to content

Commit

Permalink
修复用户获取逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Apr 19, 2017
1 parent 0a713a4 commit 8176195
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ public static void removeCurrentUser() {
public static User getLoginUser(HttpServletRequest request) {
if (request == null) return ThreadLocalUtils.get("current-user");
HttpSession session = request.getSession(false);
if (session == null) {
User user = null;
if (session != null) {
user = getLoginUser(session);
}
if (user == null) {
OAuth2Manager manager = OAuth2ManagerHolder.getManager();
if (manager != null) {
return manager.getUserByRequest(request);
user = manager.getUserByRequest(request);
}
return null;
}
return getLoginUser(session);
return user;
}

public static Map<String, String> getHeaders(HttpServletRequest request) {
Expand Down

0 comments on commit 8176195

Please sign in to comment.