修改上传文件超过100m提示

This commit is contained in:
gaosong
2022-08-10 17:41:09 +08:00
parent b1f3276000
commit 3a3d846e93
2 changed files with 32 additions and 32 deletions
@@ -85,11 +85,11 @@ public class JeroBootExceptionHandler {
/**
* spring默认上传大小100MB 超出大小捕获异常MaxUploadSizeExceededException
*/
@ExceptionHandler(MaxUploadSizeExceededException.class)
public Result<?> handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) {
log.error(e.getMessage(), e);
return Result.error("文件大小超出100MB限制, 请压缩或降低文件质量! ");
}
// @ExceptionHandler(MaxUploadSizeExceededException.class)
// public Result<?> handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) {
// log.error(e.getMessage(), e);
// return Result.error("文件大小超出100MB限制, 请压缩或降低文件质量! ");
// }
@ExceptionHandler(DataIntegrityViolationException.class)
public Result<?> handleDataIntegrityViolationException(DataIntegrityViolationException e) {