mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-28 22:51:54 +00:00
update 使用 jackson 替换 fastjson
This commit is contained in:
8
pom.xml
8
pom.xml
@@ -33,7 +33,6 @@
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<fastjson.version>1.2.79</fastjson.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<common-pool.version>2.10.0</common-pool.version>
|
||||
@@ -192,13 +191,6 @@
|
||||
<version>${commons-collections.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON 解析器和生成器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 线程传递值 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
@@ -75,12 +75,6 @@
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Alibaba Fastjson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jaxb -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
|
@@ -18,7 +18,6 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.core.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
@@ -302,7 +301,7 @@ public class ServletUtils
|
||||
response.setStatusCode(status);
|
||||
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, contentType);
|
||||
R<?> result = R.fail(code, value.toString());
|
||||
DataBuffer dataBuffer = response.bufferFactory().wrap(JSONObject.toJSONString(result).getBytes());
|
||||
DataBuffer dataBuffer = response.bufferFactory().wrap(JsonUtils.toJsonString(result).getBytes());
|
||||
return response.writeWith(Mono.just(dataBuffer));
|
||||
}
|
||||
}
|
||||
|
@@ -5,19 +5,18 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.json.JSON;
|
||||
import com.ruoyi.common.core.utils.JsonUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ruoyi.common.core.utils.ServletUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||
@@ -130,7 +129,7 @@ public class LogAspect
|
||||
// 是否需要保存response,参数和值
|
||||
if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult))
|
||||
{
|
||||
operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
||||
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +154,7 @@ public class LogAspect
|
||||
*/
|
||||
private String argsArrayToString(Object[] paramsArray)
|
||||
{
|
||||
String params = "";
|
||||
StringBuilder params = new StringBuilder();
|
||||
if (paramsArray != null && paramsArray.length > 0)
|
||||
{
|
||||
for (Object o : paramsArray)
|
||||
@@ -164,8 +163,7 @@ public class LogAspect
|
||||
{
|
||||
try
|
||||
{
|
||||
Object jsonObj = JSON.toJSON(o);
|
||||
params += jsonObj.toString() + " ";
|
||||
params.append(JsonUtils.toJsonString(o)).append(" ");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -173,7 +171,7 @@ public class LogAspect
|
||||
}
|
||||
}
|
||||
}
|
||||
return params.trim();
|
||||
return params.toString().trim();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user