wenhongquan há 2 meses atrás
pai
commit
47543527af

+ 9 - 7
ruoyi-admin/src/main/java/org/dromara/web/task/KafkaMessageConsumer.java

@@ -192,14 +192,16 @@ public class KafkaMessageConsumer {
             FileUtil.mkdir("./temp/");
         }
         File file = HttpUtil.downloadFileFromUrl(path, FileUtil.file("./temp/"));
-        try{
-            String pathfile = "./"+ UUID.fastUUID()+".mp4";
-            Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
-            FileUtil.del(file);
-            file =  new File(pathfile);;
-        }catch (Exception e){
-
+        if(path.endsWith(".mp4")){
+            try{
+                String pathfile = "./"+ UUID.fastUUID()+".mp4";
+                Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
+                FileUtil.del(file);
+                file =  new File(pathfile);;
+            }catch (Exception e){
+            }
         }
+
         SysOssVo oss = SpringUtils.getBean(ISysOssService.class).upload(file);
         FileUtil.del(file);
         return oss.getFileName();