Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cfld-postcard-service
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
cfld-backend
cfld-postcard-service
Commits
74a1545a
Commit
74a1545a
authored
Dec 21, 2023
by
zhouxudong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理异常
parent
8b5256f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
CurrentUserInterceptor.java
.../postcard/service/config/auth/CurrentUserInterceptor.java
+7
-1
No files found.
src/main/java/com/postcard/service/config/auth/CurrentUserInterceptor.java
View file @
74a1545a
...
...
@@ -24,7 +24,13 @@ public class CurrentUserInterceptor implements AsyncHandlerInterceptor {
throw
new
AuthException
(
"未授权,请重新登录"
);
}
String
token
=
authToken
.
substring
(
"Bearer"
.
length
()
+
1
).
trim
();
JwtInfo
jwtUser
=
JwtTokenUtil
.
getJwtUser
(
token
);
JwtInfo
jwtUser
;
try
{
jwtUser
=
JwtTokenUtil
.
getJwtUser
(
token
);
}
catch
(
Exception
e
){
throw
new
AuthException
(
"未授权,请重新登录"
);
}
// 根据token信息,生成当前登录用户信息的设置,存放容器threadlocal
BaseContextHandler
.
setCurrentUserInfo
(
jwtUser
);
...
...
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