From d241b67a5728d4f2bb0d33e4921229a4bf15e250 Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期四, 05 六月 2025 14:11:42 +0800 Subject: [PATCH] 付款登记功能开发 --- src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 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..ef335f3 100644 --- a/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java +++ b/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -7,8 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import com.alibaba.fastjson.JSONObject; -import com.ruoyi.common.constant.Constants; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.filter.RepeatedlyRequestWrapper; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.http.HttpHelper; @@ -50,7 +50,7 @@ // body鍙傛暟涓虹┖锛岃幏鍙朠arameter鐨勬暟鎹� if (StringUtils.isEmpty(nowParams)) { - nowParams = JSONObject.toJSONString(request.getParameterMap()); + nowParams = JSON.toJSONString(request.getParameterMap()); } Map<String, Object> nowDataMap = new HashMap<String, Object>(); nowDataMap.put(REPEAT_PARAMS, nowParams); @@ -58,16 +58,12 @@ // 璇锋眰鍦板潃锛堜綔涓哄瓨鏀綾ache鐨刱ey鍊硷級 String url = request.getRequestURI(); - - // 鍞竴鍊硷紙娌℃湁娑堟伅澶村垯浣跨敤璇锋眰鍦板潃锛� - String submitKey = request.getHeader(header); - if (StringUtils.isEmpty(submitKey)) - { - submitKey = url; - } - // 鍞竴鏍囪瘑锛堟寚瀹歬ey + 娑堟伅澶达級 - String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey; + // 鍞竴鍊硷紙娌℃湁娑堟伅澶村垯浣跨敤璇锋眰鍦板潃锛� + String submitKey = StringUtils.trimToEmpty(request.getHeader(header)); + + // 鍞竴鏍囪瘑锛堟寚瀹歬ey + url + 娑堟伅澶达級 + String cacheRepeatKey = CacheConstants.REPEAT_SUBMIT_KEY + url + submitKey; Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); if (sessionObj != null) -- Gitblit v1.9.3