Commit 7a7764b9 authored by 廖旭伟's avatar 廖旭伟

上传接口修改

parent 285d181b
...@@ -50,9 +50,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -50,9 +50,7 @@ public class UploadServiceImpl implements UploadService {
throw new AppException("没有要上传的文件!"); throw new AppException("没有要上传的文件!");
} }
if(StringUtils.isEmpty(prePath)){ if(StringUtils.isEmpty(prePath)){
prePath = "file/uploadfile/"; prePath = "file/uploadfile";
}else {
prePath = prePath.endsWith("/")?prePath:prePath+"/";
} }
String fileName = tempFile.getOriginalFilename(); String fileName = tempFile.getOriginalFilename();
String extension = FilenameUtils.getExtension(fileName); String extension = FilenameUtils.getExtension(fileName);
...@@ -66,8 +64,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -66,8 +64,7 @@ public class UploadServiceImpl implements UploadService {
} }
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/"; String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
// String filePath = rootPath + (StringUtils.isEmpty(prePath) ? "file/uploadfile/" : prePath + "/"); String filePath = rootPath + (StringUtils.isEmpty(prePath) ? "" : prePath + "/");
String filePath = rootPath + prePath;
File pathDir = new File(filePath); File pathDir = new File(filePath);
if (!pathDir.exists()) { if (!pathDir.exists()) {
pathDir.mkdirs(); pathDir.mkdirs();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment