Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-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
hubin
long-tern-care-service
Commits
f8beffc9
Commit
f8beffc9
authored
Feb 13, 2023
by
maqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会话不失效
parent
129ed8d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
AuthorizationManager.java
...m/hungraim/ltc/gateway/security/AuthorizationManager.java
+3
-4
No files found.
gateway-service/src/main/java/com/hungraim/ltc/gateway/security/AuthorizationManager.java
View file @
f8beffc9
...
@@ -37,8 +37,6 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
...
@@ -37,8 +37,6 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
private
final
RedisTemplate
redisTemplate
;
private
final
RedisTemplate
redisTemplate
;
private
RedisCache
redisCache
;
@Autowired
@Autowired
public
AuthorizationManager
(
RedisTemplate
redisTemplate
)
{
public
AuthorizationManager
(
RedisTemplate
redisTemplate
)
{
this
.
redisTemplate
=
redisTemplate
;
this
.
redisTemplate
=
redisTemplate
;
...
@@ -67,10 +65,11 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
...
@@ -67,10 +65,11 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
log
.
info
(
"请求token为空拒绝访问,path={}"
,
path
);
log
.
info
(
"请求token为空拒绝访问,path={}"
,
path
);
return
Mono
.
just
(
new
AuthorizationDecision
(
false
));
return
Mono
.
just
(
new
AuthorizationDecision
(
false
));
}
}
String
claims
=
JwtHelper
.
decode
(
token
).
getClaims
();
String
subToken
=
token
.
substring
(
AuthConstants
.
JWT_PREFIX
.
length
());
String
claims
=
JwtHelper
.
decode
(
subToken
).
getClaims
();
String
jti
=
(
String
)
JSONObject
.
parseObject
(
claims
).
get
(
"jti"
);
String
jti
=
(
String
)
JSONObject
.
parseObject
(
claims
).
get
(
"jti"
);
String
acc_token
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
jti
);
String
acc_token
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
jti
);
if
(
StrUtil
.
isBlank
(
acc_token
))
{
if
(
!
StrUtil
.
isBlank
(
acc_token
))
{
log
.
info
(
"请求token为空拒绝访问,path={}"
,
path
);
log
.
info
(
"请求token为空拒绝访问,path={}"
,
path
);
return
Mono
.
just
(
new
AuthorizationDecision
(
false
));
return
Mono
.
just
(
new
AuthorizationDecision
(
false
));
}
}
...
...
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