修改上传文件超过100m提示
This commit is contained in:
+5
-5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user