Răsfoiți Sursa

优化上传图片

xuqiang 3 ani în urmă
părinte
comite
1e4cd58656

+ 4 - 5
src/main/java/com/izouma/nineth/web/FileUploadController.java

@@ -73,9 +73,9 @@ public class FileUploadController {
             ByteArrayOutputStream os = new ByteArrayOutputStream();
             ImageIO.write(img, ext, os);
             InputStream is = new ByteArrayInputStream(os.toByteArray());
-            return "https://"+storageService.uploadFromInputStream(is, path);
+            return storageService.uploadFromInputStream(is, path);
         }
-        return "https://"+storageService.uploadFromInputStream(file.getInputStream(), path);
+        return storageService.uploadFromInputStream(file.getInputStream(), path);
     }
 
     @PostMapping("/base64")
@@ -141,11 +141,10 @@ public class FileUploadController {
             ByteArrayOutputStream os = new ByteArrayOutputStream();
             ImageIO.write(img, ext, os);
             InputStream is = new ByteArrayInputStream(os.toByteArray());
-            url = "https://"+storageService.uploadFromInputStream(is, path);
+            url = storageService.uploadFromInputStream(is, path);
         } else {
-            url = "https://"+storageService.uploadFromInputStream(new FileInputStream(tmpFile), path);
+            url = storageService.uploadFromInputStream(new FileInputStream(tmpFile), path);
         }
-
         String thumbUrl = null;