From 434b1a7e630508646d7286ee5a18c6fbfba40abf Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Tue, 23 Mar 2021 14:23:06 +0800 Subject: [PATCH] =?UTF-8?q?BindingResult=E6=97=A0=E6=B3=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20#2219?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/jeecg/common/aspect/AutoLogAspect.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java index 80fd99f..86561ad 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java @@ -14,14 +14,16 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.enums.ModuleType; -import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.IPUtils; import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.base.service.BaseCommonService; import org.springframework.core.LocalVariableTableParameterNameDiscoverer; import org.springframework.stereotype.Component; +import org.springframework.validation.BindingResult; import org.springframework.web.multipart.MultipartFile; + import javax.annotation.Resource; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -157,7 +159,7 @@ public class AutoLogAspect { // https://my.oschina.net/mengzhang6/blog/2395893 Object[] arguments = new Object[paramsArray.length]; for (int i = 0; i < paramsArray.length; i++) { - if (paramsArray[i] instanceof ServletRequest || paramsArray[i] instanceof ServletResponse || paramsArray[i] instanceof MultipartFile) { + if (paramsArray[i] instanceof BindingResult || paramsArray[i] instanceof ServletRequest || paramsArray[i] instanceof ServletResponse || paramsArray[i] instanceof MultipartFile) { //ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false) //ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response continue; -- GitLab