Browse Source

图片上传修改

master
zhaoqifeng 5 years ago
parent
commit
51ad6b41ea
  1. 3
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

3
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -55,7 +55,6 @@ public class OssController {
private ParamsRemoteService paramsRemoteService; private ParamsRemoteService paramsRemoteService;
private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY; private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY;
public static final String IMAGE_JPG_VALUE = "image/jpg";
@GetMapping("page") @GetMapping("page")
@ApiOperation(value = "分页") @ApiOperation(value = "分页")
@ -191,7 +190,7 @@ public class OssController {
public Result<UploadImgResultDTO> uploadArticleImg(@RequestParam("file") MultipartFile file) { public Result<UploadImgResultDTO> uploadArticleImg(@RequestParam("file") MultipartFile file) {
// 校验文件类型 // 校验文件类型
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !IMAGE_JPG_VALUE.equals(file.getContentType())) { if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(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());
} }

Loading…
Cancel
Save