Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hphy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
向怀芳
hphy
Commits
767a02be
Commit
767a02be
authored
Oct 21, 2022
by
向怀芳
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 代理IP处理02
parent
356ff45a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
255 additions
and
254 deletions
+255
-254
SictTokenEndpoint.java
...cn/sh/stc/sict/cloud/auth/endpoint/SictTokenEndpoint.java
+1
-4
WebUtils.java
.../java/cn/sh/stc/sict/cloud/common/core/util/WebUtils.java
+253
-249
RequestGlobalFilter.java
...sict/cloud/common/gateway/filter/RequestGlobalFilter.java
+1
-1
No files found.
cloud-auth/src/main/java/cn/sh/stc/sict/cloud/auth/endpoint/SictTokenEndpoint.java
View file @
767a02be
...
...
@@ -80,10 +80,7 @@ public class SictTokenEndpoint {
String
tokenValue
=
authHeader
.
replaceAll
(
"(?i)Bearer"
,
""
).
trim
();
OAuth2AccessToken
accessToken
=
tokenStore
.
readAccessToken
(
tokenValue
);
if
(
accessToken
==
null
||
StrUtil
.
isBlank
(
accessToken
.
getValue
()))
{
return
R
.
builder
()
.
code
(
Constant
.
BYTE_NO
)
.
data
(
Boolean
.
FALSE
)
.
msg
(
"退出失败,token 无效"
).
build
();
return
new
R
();
}
OAuth2Authentication
auth2Authentication
=
tokenStore
.
readAuthentication
(
accessToken
);
...
...
cloud-common/cloud-common-core/src/main/java/cn/sh/stc/sict/cloud/common/core/util/WebUtils.java
View file @
767a02be
This diff is collapsed.
Click to expand it.
cloud-common/cloud-common-gateway/src/main/java/cn/sh/stc/sict/cloud/common/gateway/filter/RequestGlobalFilter.java
View file @
767a02be
...
...
@@ -65,7 +65,7 @@ public class RequestGlobalFilter implements GlobalFilter, Ordered {
// IP白名单
String
ip
=
WebUtils
.
getIP
(
request
);
//
log.error("RemoteAddress = {}, ip = {}", request.getRemoteAddress(), ip);
log
.
error
(
"RemoteAddress = {}, ip = {}"
,
request
.
getRemoteAddress
(),
ip
);
try
{
if
(
whitIPConfig
.
getLimitFlag
()
&&
!
IPStrUtil
.
matches
(
ip
,
whitIPConfig
.
getWhites
()))
{
ServerHttpResponse
response
=
exchange
.
getResponse
();
...
...
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