Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-wx-store-sharer
Overview
Overview
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
wx
yanxuan-wx-store-sharer
Commits
361145f9
Commit
361145f9
authored
Mar 20, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息加入unionId
parent
418efa80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
UserInterceptor.java
...xuan/wx/store/sharer/biz/interceptor/UserInterceptor.java
+4
-0
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/interceptor/UserInterceptor.java
View file @
361145f9
...
@@ -4,6 +4,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder;
...
@@ -4,6 +4,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo
;
import
com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant
;
import
com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant
;
import
com.netease.yanxuan.wx.store.sharer.common.exception.NoAuthException
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -30,6 +31,9 @@ public class UserInterceptor implements HandlerInterceptor {
...
@@ -30,6 +31,9 @@ public class UserInterceptor implements HandlerInterceptor {
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
LoginUserInfo
loginUserInfo
=
loginUserHelper
.
getLoginUserInfo
(
token
);
LoginUserInfo
loginUserInfo
=
loginUserHelper
.
getLoginUserInfo
(
token
);
if
(
null
!=
loginUserInfo
)
{
if
(
null
!=
loginUserInfo
)
{
if
(
StringUtils
.
isBlank
(
loginUserInfo
.
getUnionId
()))
{
throw
new
NoAuthException
(
"用户登录状态过期"
);
}
// 刷新缓存
// 刷新缓存
loginUserHelper
.
setLoginUserInfo
(
token
,
loginUserInfo
);
loginUserHelper
.
setLoginUserInfo
(
token
,
loginUserInfo
);
LoginUserContextHolder
.
set
(
loginUserInfo
);
LoginUserContextHolder
.
set
(
loginUserInfo
);
...
...
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