From 9fa3eac3aae9d29558c48acd0396b3f655706fb1 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 26 May 2022 09:02:32 +0800
Subject: [PATCH] 升级fastjson到最新版2.0.4
---
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
index 33c9c87..0c5a40d 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
@@ -7,7 +7,7 @@
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.alibaba.fastjson2.JSON;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.redis.RedisCache;
@@ -50,7 +50,7 @@
// body参数为空,获取Parameter的数据
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);
@@ -60,14 +60,10 @@
String url = request.getRequestURI();
// 唯一值(没有消息头则使用请求地址)
- String submitKey = request.getHeader(header);
- if (StringUtils.isEmpty(submitKey))
- {
- submitKey = url;
- }
+ String submitKey = StringUtils.trimToEmpty(request.getHeader(header));
- // 唯一标识(指定key + 消息头)
- String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey;
+ // 唯一标识(指定key + url + 消息头)
+ String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey;
Object sessionObj = redisCache.getCacheObject(cacheRepeatKey);
if (sessionObj != null)
--
Gitblit v1.9.2