Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
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
finance-oa
finance-manage
Commits
1efae4a5
Commit
1efae4a5
authored
Aug 10, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化防重复提交拦截器,接口请求非json数据不获取Body消息体
parent
a78211ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
...yi/framework/interceptor/impl/SameUrlDataInterceptor.java
+8
-2
No files found.
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
View file @
1efae4a5
...
...
@@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.constant.Constants
;
...
...
@@ -50,9 +51,14 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
@SuppressWarnings
(
"unchecked"
)
@Override
public
boolean
isRepeatSubmit
(
HttpServletRequest
request
)
{
String
nowParams
=
""
;
if
(
request
instanceof
HttpServletRequest
&&
StringUtils
.
equalsAnyIgnoreCase
(
request
.
getContentType
(),
MediaType
.
APPLICATION_JSON_VALUE
,
MediaType
.
APPLICATION_JSON_UTF8_VALUE
))
{
RepeatedlyRequestWrapper
repeatedlyRequest
=
(
RepeatedlyRequestWrapper
)
request
;
String
nowParams
=
HttpHelper
.
getBodyString
(
repeatedlyRequest
);
nowParams
=
HttpHelper
.
getBodyString
(
repeatedlyRequest
);
}
// body参数为空,获取Parameter的数据
if
(
StringUtils
.
isEmpty
(
nowParams
))
...
...
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