Commit 2d335dc2 authored by Ryan Loong's avatar Ryan Loong

fix 文件导出

parent efa9fa81
......@@ -175,8 +175,9 @@ public class WxStorageController {
}
String type = storage.getType();
MediaType mediaType = MediaType.parseMediaType(type);
if(type.equals("application/x-zip-compressed")){
MediaType mediaType = MediaType.parseMediaType(type);
Resource file = storageService.loadAsResource(key);
if(file == null) {
ResponseEntity.notFound();
......@@ -184,7 +185,6 @@ public class WxStorageController {
return ResponseEntity.ok().contentType(mediaType).header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + file.getFilename() + "\"").body(file);
} else if (type.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
MediaType mediaType = MediaType.parseMediaType(type);
Resource file = storageService.loadAsResource(key);
if(file == null) {
ResponseEntity.notFound();
......@@ -193,10 +193,6 @@ public class WxStorageController {
"attachment; filename=\"" + URLEncoder.encode(storage.getName(), "UTF-8") + "\"").body(file);
}
MediaType mediaType = MediaType.parseMediaType(type);
Resource file = storageService.getLocalStorage().loadAsResource(key);
if (file == null) {
return ResponseEntity.notFound().build();
......
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