|
@@ -2,7 +2,6 @@ package com.qmth.boot.api.utils;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.qmth.boot.api.config.ApiProperties;
|
|
import com.qmth.boot.api.config.ApiProperties;
|
|
-import com.qmth.boot.api.constant.ApiConstant;
|
|
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.aspectj.lang.reflect.MethodSignature;
|
|
import org.aspectj.lang.reflect.MethodSignature;
|
|
@@ -25,12 +24,15 @@ public class HttpTraceUtil {
|
|
|
|
|
|
private boolean enable;
|
|
private boolean enable;
|
|
|
|
|
|
|
|
+ private String prefix;
|
|
|
|
+
|
|
public HttpTraceUtil(ApiProperties apiProperties) {
|
|
public HttpTraceUtil(ApiProperties apiProperties) {
|
|
this.enable = apiProperties.isHttpTrace();
|
|
this.enable = apiProperties.isHttpTrace();
|
|
|
|
+ this.prefix = apiProperties.getUriPrefix();
|
|
}
|
|
}
|
|
|
|
|
|
public void request(HttpServletRequest request, MethodSignature method, Object[] args) {
|
|
public void request(HttpServletRequest request, MethodSignature method, Object[] args) {
|
|
- if (this.enable && !request.getServletPath().equals(ApiConstant.DEFAULT_ERROR_URI)) {
|
|
|
|
|
|
+ if (this.enable && request.getServletPath().startsWith(prefix)) {
|
|
try {
|
|
try {
|
|
Map<String, Object> content = new LinkedHashMap<>();
|
|
Map<String, Object> content = new LinkedHashMap<>();
|
|
content.put("uri", request.getServletPath());
|
|
content.put("uri", request.getServletPath());
|