xuqiang преди 4 години
родител
ревизия
8c49612ef6
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 4
      src/main/java/com/izouma/nineth/web/FileUploadController.java

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

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