Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
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
reyun
manager
Commits
3395b477
Commit
3395b477
authored
Jan 30, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同
parent
a2922dc7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
workspace.xml
.idea/workspace.xml
+0
-0
AuthorizationInterceptor.java
...n/java/security/interceptor/AuthorizationInterceptor.java
+1
-2
No files found.
.idea/workspace.xml
View file @
3395b477
This diff is collapsed.
Click to expand it.
src/main/java/security/interceptor/AuthorizationInterceptor.java
View file @
3395b477
...
@@ -48,7 +48,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
...
@@ -48,7 +48,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
}
}
//从header中得到token
//从header中得到token
String
token
=
request
.
getHeader
(
httpHeaderName
);
String
token
=
request
.
getHeader
(
httpHeaderName
);
token
=
StringUtil
.
isEmpty
(
token
)
?
getCookieToken
(
request
.
getCookies
(),
"TOKEN"
)
:
token
;
//
token = StringUtil.isEmpty(token) ? getCookieToken(request.getCookies(), "TOKEN") : token;
token
=
token
.
substring
(
httpHeaderPrefix
.
length
());
token
=
token
.
substring
(
httpHeaderPrefix
.
length
());
//验证token
//验证token
String
key
=
manager
.
getKeyFromToken
(
token
);
String
key
=
manager
.
getKeyFromToken
(
token
);
...
@@ -56,7 +56,6 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
...
@@ -56,7 +56,6 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
boolean
loginStatus
=
redisLoginStatusManager
.
getLoginStatusByKey
(
token
);
boolean
loginStatus
=
redisLoginStatusManager
.
getLoginStatusByKey
(
token
);
if
(!
StringUtil
.
isEmpty
(
key
))
{
if
(!
StringUtil
.
isEmpty
(
key
))
{
String
id
=
getCookieToken
(
request
.
getCookies
(),
"TOKEN"
);
User
one
=
userRepository
.
findOne
(
Long
.
parseLong
(
key
));
User
one
=
userRepository
.
findOne
(
Long
.
parseLong
(
key
));
User
sessionAct
=
(
User
)
request
.
getSession
().
getAttribute
(
Constant
.
CURRENT_ACCOUNT
);
User
sessionAct
=
(
User
)
request
.
getSession
().
getAttribute
(
Constant
.
CURRENT_ACCOUNT
);
...
...
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