Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
ad4df624
Commit
ad4df624
authored
Aug 11, 2020
by
RuoYi
Browse files
优化防重复提交拦截器,请求没有消息头则使用地址
parent
71ec44a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
View file @
ad4df624
...
...
@@ -70,8 +70,15 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
// 请求地址(作为存放cache的key值)
String
url
=
request
.
getRequestURI
();
// 唯一值(没有消息头则使用请求地址)
String
submitKey
=
request
.
getHeader
(
header
);
if
(
StringUtils
.
isEmpty
(
submitKey
))
{
submitKey
=
url
;
}
// 唯一标识(指定key + 消息头)
String
cache_repeat_key
=
Constants
.
REPEAT_SUBMIT_KEY
+
request
.
getHeader
(
header
)
;
String
cache_repeat_key
=
Constants
.
REPEAT_SUBMIT_KEY
+
submitKey
;
Object
sessionObj
=
redisCache
.
getCacheObject
(
cache_repeat_key
);
if
(
sessionObj
!=
null
)
...
...
Write
Preview
Supports
Markdown
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