[fix] fix the bug of aop web log for file upload

This commit is contained in:
朱八 2020-07-13 19:46:11 +08:00
parent 9ac3929a8e
commit 70920a9220
2 changed files with 10 additions and 3 deletions

View File

@ -9,7 +9,7 @@
<version>1.0.0</version> <version>1.0.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>powerjob</name> <name>powerjob</name>
<url>https://github.com/KFCFans/OhMyScheduler</url> <url>https://github.com/KFCFans/PowerJob</url>
<description>Distributed scheduling and execution framework</description> <description>Distributed scheduling and execution framework</description>
<licenses> <licenses>
<license> <license>
@ -19,8 +19,8 @@
</license> </license>
</licenses> </licenses>
<scm> <scm>
<url>https://github.com/KFCFans/OhMyScheduler</url> <url>https://github.com/KFCFans/PowerJob</url>
<connection>https://github.com/KFCFans/OhMyScheduler.git</connection> <connection>https://github.com/KFCFans/PowerJob.git</connection>
</scm> </scm>
<developers> <developers>

View File

@ -8,9 +8,11 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -86,6 +88,11 @@ public class WebLogAspect {
if (obj instanceof HttpServletRequest || obj instanceof HttpServletResponse) { if (obj instanceof HttpServletRequest || obj instanceof HttpServletResponse) {
break; break;
} }
// FatJar
if (obj instanceof MultipartFile || obj instanceof Resource) {
break;
}
objList.add(obj); objList.add(obj);
} }
return JSONObject.toJSONString(objList); return JSONObject.toJSONString(objList);