Browse Source

Merge branch 'hotfix-54089' into test

dengsixing 1 week ago
parent
commit
e5f74300d2

+ 6 - 3
src/main/java/com/fdkankan/scene/service/impl/CommonServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fdkankan.scene.service.impl;
 package com.fdkankan.scene.service.impl;
 
 
+import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.common.util.FileUtils;
@@ -46,12 +47,14 @@ public class CommonServiceImpl implements ICommonService {
         String filePath = userEditPath + fileName;
         String filePath = userEditPath + fileName;
         fYunFileService.downloadFile(bucket, filePath, localImagesPath + fileName);
         fYunFileService.downloadFile(bucket, filePath, localImagesPath + fileName);
 
 
+        String extName = FileUtil.extName(fileName);
+
         //视频格式转换
         //视频格式转换
-        CreateObjUtil.mp4ToFlv(localFilePath, localFilePath.replace("mp4", "flv"));
+        CreateObjUtil.mp4ToFlv(localFilePath, localFilePath.replace(extName, "flv"));
 
 
         //上传
         //上传
-        String flvFileName = fileName.replace("mp4", "flv");
-        fYunFileService.uploadFile(bucket, localFilePath.replace("mp4", "flv"), userEditPath+flvFileName);
+        String flvFileName = fileName.replace(extName, "flv");
+        fYunFileService.uploadFile(bucket, localFilePath.replace(extName, "flv"), userEditPath+flvFileName);
     }
     }
 
 
     @Override
     @Override