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

View File

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