Ver Fonte

fix:解决minio自定义文件路径后生成的下载url错误问题

xiaobao há 2 anos atrás
pai
commit
065fb71637

+ 5 - 3
im-platform/src/main/java/com/bx/implatform/service/thirdparty/FileService.java

@@ -40,6 +40,8 @@ public class FileService {
     private String imagePath;
     @Value("${minio.filePath}")
     private String filePath;
+    @Value("${minio.videoPath}")
+    private String videoPath;
 
 
     @PostConstruct
@@ -109,13 +111,13 @@ public class FileService {
         String url = minIoServer + "/" + bucketName;
         switch (fileTypeEnum) {
             case FILE:
-                url += "/file/";
+                url += "/"+filePath+"/";
                 break;
             case IMAGE:
-                url += "/image/";
+                url += "/"+imagePath+"/";
                 break;
             case VIDEO:
-                url += "/video/";
+                url += "/"+videoPath+"/";
                 break;
             default:
                 break;

+ 1 - 0
im-platform/src/main/resources/application.yml

@@ -39,6 +39,7 @@ minio:
   bucketName: box-im
   imagePath: image
   filePath: file
+  videoPath: video
 
 webrtc:
   iceServers: