From a9f0852947cf017e1b0073cb5afe0867567c416d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 30 Dec 2021 14:15:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E7=BB=84=E5=90=88=EF=BC=88key=20+=20url=20+?= =?UTF-8?q?=20header=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interceptor/impl/SameUrlDataInterceptor.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java index a7b3b34..2a2d79a 100644 --- a/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java +++ b/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -58,16 +58,12 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor // 请求地址(作为存放cache的key值) String url = request.getRequestURI(); - - // 唯一值(没有消息头则使用请求地址) - String submitKey = request.getHeader(header); - if (StringUtils.isEmpty(submitKey)) - { - submitKey = url; - } - // 唯一标识(指定key + 消息头) - String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey; + // 唯一值(没有消息头则使用请求地址) + String submitKey = StringUtils.trimToEmpty(request.getHeader(header)); + + // 唯一标识(指定key + url + 消息头) + String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey; Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); if (sessionObj != null)