Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-enterprise-base
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
base_platform_enterprise
gic-enterprise-base
Commits
7300e49b
Commit
7300e49b
authored
Jun 16, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
有些免登录需要用到session数据 See merge request
!6
parents
8fad1544
84dc7832
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
AuthInterceptor.java
.../java/com/gic/enterprise/interceptor/AuthInterceptor.java
+7
-5
No files found.
gic-enterprise-common/src/main/java/com/gic/enterprise/interceptor/AuthInterceptor.java
View file @
7300e49b
...
...
@@ -73,18 +73,20 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
}
//判断是否有权限的路径
UserDetail
userDetail
=
UserContext
.
getContext
().
getByRedis
();
if
(
userDetail
==
null
||
userDetail
.
getUserInfo
()
==
null
)
{
throw
new
CommonException
(
ErrorCode
.
LOGIN_INVALID
.
getErrorCode
(),
"登录信息不存在,请登录"
);
}
request
.
setAttribute
(
"user"
,
userDetail
);
HandlerMethod
handler
=
(
HandlerMethod
)
object
;
//免登录接口路由
IgnoreLogin
ignoreLogin
=
handler
.
getMethodAnnotation
(
IgnoreLogin
.
class
);
if
(
null
!=
ignoreLogin
)
{
//有些免登录需要用到session数据
request
.
setAttribute
(
"user"
,
userDetail
);
return
true
;
}
if
(
userDetail
==
null
||
userDetail
.
getUserInfo
()
==
null
)
{
throw
new
CommonException
(
ErrorCode
.
LOGIN_INVALID
.
getErrorCode
(),
"登录信息不存在,请登录"
);
}
request
.
setAttribute
(
"user"
,
userDetail
);
//不需要拦截的路径
if
(
ignoreUriAfterLoginMap
.
containsKey
(
uri
))
{
...
...
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