Commit ff8a52418b527b2971118737c23bb5d15d6f3d9b
1 parent
3b97b1b0
refactor(framework): 简化 API 访问日志请求体读取
Showing
2 changed files
with
2 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
| ... | ... | @@ -69,7 +69,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { |
| 69 | 69 | LocalDateTime beginTime = LocalDateTime.now(); |
| 70 | 70 | // 提前获得参数,避免 XssFilter 过滤处理 |
| 71 | 71 | Map<String, String> queryString = ServletUtils.getParamMap(request); |
| 72 | - String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtils.getBody(request) : null; | |
| 72 | + String requestBody = ServletUtils.getBody(request); | |
| 73 | 73 | |
| 74 | 74 | try { |
| 75 | 75 | // 继续过滤器 | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/interceptor/ApiAccessLogInterceptor.java
| ... | ... | @@ -44,7 +44,7 @@ public class ApiAccessLogInterceptor implements HandlerInterceptor { |
| 44 | 44 | // 打印 request 日志 |
| 45 | 45 | if (!SpringUtils.isProd()) { |
| 46 | 46 | Map<String, String> queryString = ServletUtils.getParamMap(request); |
| 47 | - String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtils.getBody(request) : null; | |
| 47 | + String requestBody = ServletUtils.getBody(request); | |
| 48 | 48 | if (CollUtil.isEmpty(queryString) && StrUtil.isEmpty(requestBody)) { |
| 49 | 49 | log.info("[preHandle][开始请求 URL({}) 无参数]", request.getRequestURI()); |
| 50 | 50 | } else { | ... | ... |