update 防重复提交标识组合 改为 key + url + header
This commit is contained in:
parent
9bad713db5
commit
fc8c96399f
@ -57,13 +57,11 @@ public class RepeatSubmitAspect {
|
|||||||
String url = request.getRequestURI();
|
String url = request.getRequestURI();
|
||||||
|
|
||||||
// 唯一值(没有消息头则使用请求地址)
|
// 唯一值(没有消息头则使用请求地址)
|
||||||
String submitKey = request.getHeader(tokenProperties.getHeader());
|
String submitKey = StringUtils.trimToEmpty(request.getHeader(tokenProperties.getHeader()));
|
||||||
if (StringUtils.isEmpty(submitKey)) {
|
|
||||||
submitKey = url;
|
|
||||||
}
|
|
||||||
submitKey = SecureUtil.md5(submitKey + ":" + nowParams);
|
submitKey = SecureUtil.md5(submitKey + ":" + nowParams);
|
||||||
// 唯一标识(指定key + 消息头)
|
// 唯一标识(指定key + url + 消息头)
|
||||||
String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey;
|
String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey;
|
||||||
String key = RedisUtils.getCacheObject(cacheRepeatKey);
|
String key = RedisUtils.getCacheObject(cacheRepeatKey);
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
RedisUtils.setCacheObject(cacheRepeatKey, "", interval, TimeUnit.MILLISECONDS);
|
RedisUtils.setCacheObject(cacheRepeatKey, "", interval, TimeUnit.MILLISECONDS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user