|
@@ -22,21 +22,21 @@ import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import jakarta.servlet.FilterChain;
|
|
|
-import jakarta.servlet.ServletException;
|
|
|
-import jakarta.servlet.http.HttpServletRequest;
|
|
|
-import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.method.HandlerMethod;
|
|
|
|
|
|
+import javax.servlet.FilterChain;
|
|
|
+import javax.servlet.ServletException;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import static cn.iocoder.yudao.framework.apilog.core.interceptor.ApiAccessLogInterceptor.*;
|
|
|
+import static cn.iocoder.yudao.framework.apilog.core.interceptor.ApiAccessLogInterceptor.ATTRIBUTE_HANDLER_METHOD;
|
|
|
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
|
|
|
|
|
|
/**
|
|
@@ -160,7 +160,8 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
|
|
|
// ========== 解析 @ApiAccessLog、@Swagger 注解 ==========
|
|
|
|
|
|
private static OperateTypeEnum parseOperateLogType(HttpServletRequest request) {
|
|
|
- RequestMethod requestMethod = RequestMethod.resolve(request.getMethod());
|
|
|
+ RequestMethod requestMethod = ArrayUtil.firstMatch(method ->
|
|
|
+ StrUtil.equalsAnyIgnoreCase(method.name(), request.getMethod()), RequestMethod.values());
|
|
|
if (requestMethod == null) {
|
|
|
return OperateTypeEnum.OTHER;
|
|
|
}
|
|
@@ -235,7 +236,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
|
|
|
return;
|
|
|
}
|
|
|
// 情况三:Object,遍历处理
|
|
|
- Iterator<Map.Entry<String, JsonNode>> iterator = node.properties().iterator();
|
|
|
+ Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
|
|
|
while (iterator.hasNext()) {
|
|
|
Map.Entry<String, JsonNode> entry = iterator.next();
|
|
|
if (ArrayUtil.contains(sanitizeKeys, entry.getKey())
|