mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-12-28 19:16:01 +08:00
fix 修复 jsonParam 参数可能为空问题
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -42,6 +43,7 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
|
||||
if (request instanceof RepeatedlyRequestWrapper) {
|
||||
BufferedReader reader = request.getReader();
|
||||
jsonParam = IoUtil.read(reader);
|
||||
if (StringUtils.isNotBlank(jsonParam)) {
|
||||
List<Dict> list = new ArrayList<>();
|
||||
if (JsonUtils.isJsonArray(jsonParam)) {
|
||||
List<String> list1 = JsonUtils.parseArray(jsonParam, String.class);
|
||||
@@ -57,12 +59,14 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
|
||||
jsonParam = JsonUtils.toJsonString(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("[PLUS]开始请求 => URL[{}],参数类型[json],参数:[{}]", url, jsonParam);
|
||||
} else {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
if (MapUtil.isNotEmpty(parameterMap)) {
|
||||
MapUtil.removeAny(parameterMap, SystemConstants.EXCLUDE_PROPERTIES);
|
||||
String parameters = JsonUtils.toJsonString(parameterMap);
|
||||
Map<String, String[]> map = new LinkedHashMap<>(parameterMap);
|
||||
MapUtil.removeAny(map, SystemConstants.EXCLUDE_PROPERTIES);
|
||||
String parameters = JsonUtils.toJsonString(map);
|
||||
log.info("[PLUS]开始请求 => URL[{}],参数类型[param],参数:[{}]", url, parameters);
|
||||
} else {
|
||||
log.info("[PLUS]开始请求 => URL[{}],无参数", url);
|
||||
|
||||
Reference in New Issue
Block a user