|
|
@@ -18,6 +18,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.exception.DemoModeException;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
|
|
|
|
|
/**
|
|
|
* 全局异常处理器
|
|
|
@@ -99,12 +100,12 @@ public class GlobalExceptionHandler
|
|
|
/**
|
|
|
* 上传文件不能超过10M
|
|
|
*/
|
|
|
- @ExceptionHandler(FileSizeLimitExceededException.class)
|
|
|
- public AjaxResult FileSizeLimitExceededException(RuntimeException e, HttpServletRequest request)
|
|
|
+ @ExceptionHandler(MaxUploadSizeExceededException.class)
|
|
|
+ public AjaxResult MaxUploadSizeExceededException(RuntimeException e, HttpServletRequest request)
|
|
|
{
|
|
|
String requestURI = request.getRequestURI();
|
|
|
log.error("上传文件不能超过10M.", requestURI, e);
|
|
|
- return AjaxResult.error("上传文件异常,文件大小不能超过10M。");
|
|
|
+ return AjaxResult.error("上传文件异常,文件大小不能超过10M!");
|
|
|
}
|
|
|
|
|
|
/**
|