Browse Source

程序优化

master
sunyuchao 5 years ago
parent
commit
d227e0fabe
  1. 1
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

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

@ -281,6 +281,7 @@ public class OssController {
public Result<UploadImgResultDTO> uploadVariedFile(@RequestParam("file") MultipartFile file) { public Result<UploadImgResultDTO> uploadVariedFile(@RequestParam("file") MultipartFile file) {
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-"; String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-";
format = format.toLowerCase();
//1.校验上传文件类型 //1.校验上传文件类型
if (!ModuleConstant.PROJECT_FILE_CONTENT.contains(format)) { if (!ModuleConstant.PROJECT_FILE_CONTENT.contains(format)) {
log.error(String.format("上传文件类型格式错误,暂不支持此类文件上传,文件名->%s", fileName)); log.error(String.format("上传文件类型格式错误,暂不支持此类文件上传,文件名->%s", fileName));

Loading…
Cancel
Save