作者 RuoYi

防重复提交标识组合(key + url + header)

@@ -60,14 +60,10 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor @@ -60,14 +60,10 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
60 String url = request.getRequestURI(); 60 String url = request.getRequestURI();
61 61
62 // 唯一值(没有消息头则使用请求地址) 62 // 唯一值(没有消息头则使用请求地址)
63 - String submitKey = request.getHeader(header);  
64 - if (StringUtils.isEmpty(submitKey))  
65 - {  
66 - submitKey = url;  
67 - } 63 + String submitKey = StringUtils.trimToEmpty(request.getHeader(header));
68 64
69 - // 唯一标识(指定key + 消息头)  
70 - String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey; 65 + // 唯一标识(指定key + url + 消息头)
  66 + String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey;
71 67
72 Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); 68 Object sessionObj = redisCache.getCacheObject(cacheRepeatKey);
73 if (sessionObj != null) 69 if (sessionObj != null)