Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
43e8fa08
Commit
43e8fa08
authored
Oct 22, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交配置校验
parent
810159b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
+0
-31
portal-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
...s/xhx/base/framework/interceptor/AuthUserInterceptor.java
+0
-31
No files found.
portal-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
View file @
43e8fa08
...
...
@@ -67,37 +67,6 @@ public class AuthUserInterceptor extends BaseInterceptor {
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
referer
=
request
.
getHeader
(
"Referer"
);
if
(!
ObjectUtils
.
isEmpty
(
referer
))
{
//校验host即可
URI
host
=
URLUtil
.
getHost
(
new
URL
(
referer
));
referer
=
host
.
getHost
();
List
<
String
>
trustReferers
=
StrUtil
.
split
(
trustedReferer
,
","
);
if
(!
ObjectUtils
.
isEmpty
(
trustReferers
))
{
if
(!
trustReferers
.
contains
(
referer
))
{
response
.
setStatus
(
HttpStatus
.
HTTP_BAD_REQUEST
);
return
false
;
}
}
}
//校验Origin
referer
=
request
.
getHeader
(
"Origin"
);
if
(!
ObjectUtils
.
isEmpty
(
referer
))
{
//校验host即可
URI
host
=
URLUtil
.
getHost
(
new
URL
(
referer
));
referer
=
host
.
getHost
();
List
<
String
>
trustReferers
=
StrUtil
.
split
(
trustedReferer
,
","
);
if
(!
ObjectUtils
.
isEmpty
(
trustReferers
))
{
if
(!
trustReferers
.
contains
(
referer
))
{
response
.
setStatus
(
HttpStatus
.
HTTP_BAD_REQUEST
);
return
false
;
}
}
}
//Origin
JSONObject
ret
=
new
JSONObject
();
try
{
if
(
handler
instanceof
HandlerMethod
)
{
...
...
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