|
@ -219,7 +219,9 @@ public class OssController { |
|
|
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) |
|
|
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) |
|
|
&& !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) |
|
|
&& !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) |
|
|
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) |
|
|
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) |
|
|
&& !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { |
|
|
&& !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType()) |
|
|
|
|
|
&& !file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX) |
|
|
|
|
|
) { |
|
|
log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); |
|
|
log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); |
|
|
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() |
|
|
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() |
|
|
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); |
|
|
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); |
|
@ -232,6 +234,13 @@ public class OssController { |
|
|
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() |
|
|
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() |
|
|
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); |
|
|
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
} else if (file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX)) { |
|
|
|
|
|
// 校验文件大小,不超过5m
|
|
|
|
|
|
long maxSize = 25 * 1024 * 1024; |
|
|
|
|
|
if (size > maxSize) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() |
|
|
|
|
|
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 校验文件大小,不超过2m
|
|
|
// 校验文件大小,不超过2m
|
|
|
long maxSize = 2 * 1024 * 1024; |
|
|
long maxSize = 2 * 1024 * 1024; |
|
|