From 99b03a3b9bc7ef476112d429fbe8b66da34e4d76 Mon Sep 17 00:00:00 2001 From: jinhaiyang Date: Fri, 12 Apr 2024 15:51:22 +0800 Subject: [PATCH] fix processRequestLog --- .../cn/axzo/pokonyan/filter/RequestLogHandlerInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cn/axzo/pokonyan/filter/RequestLogHandlerInterceptor.java b/src/main/java/cn/axzo/pokonyan/filter/RequestLogHandlerInterceptor.java index 08a8eab..f4ed817 100644 --- a/src/main/java/cn/axzo/pokonyan/filter/RequestLogHandlerInterceptor.java +++ b/src/main/java/cn/axzo/pokonyan/filter/RequestLogHandlerInterceptor.java @@ -72,7 +72,7 @@ public class RequestLogHandlerInterceptor implements HandlerInterceptor, WebMvcC boolean isJson = JSONUtil.isTypeJSON(body); boolean shortLength = body.length() < 4000; if (shortLength) { - body = isJson ? JSONUtil.toJsonStr(JSON.parseObject(body)) : body; + body = isJson ? JSONUtil.toJsonStr( JSONUtil.isTypeJSONObject(body) ? JSON.parseObject(body) : JSON.parseArray(body)) : body; log.info("[requestUrl:{}][method:{}][param:{}][body:{}]", requestUrl, method, JSON.toJSONString(request.getParameterMap()), body); return;