Commit b8618e37 authored by 廖旭伟's avatar 廖旭伟

上传接口修改

parent c2a1ca37
......@@ -62,7 +62,7 @@ public class UploadServiceImpl implements UploadService {
}
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String filePath = rootPath + (StringUtils.isEmpty(prePath) ? "" : prePath + "/");
String filePath = rootPath + (StringUtils.isEmpty(prePath) ? "file/uploadfile" : prePath + "/");
File pathDir = new File(filePath);
if (!pathDir.exists()) {
pathDir.mkdirs();
......@@ -117,7 +117,7 @@ public class UploadServiceImpl implements UploadService {
String filePath = getFilePath(fileName);
try {
File file = new File(filePath);
BufferedImage image = (BufferedImage) ImageIO.read(file);
BufferedImage image = ImageIO.read(file);
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "No-cache");
response.setDateHeader("Expires", 0L);
......
......@@ -55,7 +55,7 @@ public class UploadController extends BaseController {
@RequestMapping(value = "commonupload")
public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath") String prePath) {
public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath",defaultValue = "file/uploadfile") String prePath) {
Map<String, Object> model = new HashMap<>();
String jsonStr = "";
try {
......
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