lyhzzz 3 年之前
父節點
當前提交
ca318426ca

+ 1 - 0
src/main/java/com/fdkankan/fusion/common/util/VideoUtil.java

@@ -50,6 +50,7 @@ public class VideoUtil {
             //删除生成的ts文件
             //删除生成的ts文件
             for (String filePath : voidTS) {
             for (String filePath : voidTS) {
                 File file = new File(filePath);
                 File file = new File(filePath);
+                file.delete();
             }
             }
             return fileName;
             return fileName;
         } catch (Exception e) {
         } catch (Exception e) {

+ 1 - 2
src/main/java/com/fdkankan/fusion/service/impl/CaseVideoServiceImpl.java

@@ -118,8 +118,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
         videoFolder.setVideoMergeUrl(queryPath + ossKey);
         videoFolder.setVideoMergeUrl(queryPath + ossKey);
         videoFolder.setVideoFolderCover(queryPath + ossKeyImg);
         videoFolder.setVideoFolderCover(queryPath + ossKeyImg);
         videoFolderService.updateById(videoFolder);
         videoFolderService.updateById(videoFolder);
-        //FileUtil.del(mergeLocalPath);
-        //FileUtil.del(mergeLocalPathImg);
+        FileUtil.del(FilePath.VIDEO_LOCAL_PATH);
     }
     }
 
 
 
 

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/UploadService.java

@@ -66,7 +66,7 @@ public class UploadService {
             throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
             throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
         }finally {
         }finally {
             if(localFile!=null){
             if(localFile!=null){
-                localFile.delete();   //删除临时文件
+                localFile.deleteOnExit();   //退出删除,后续需要使用文件
             }
             }
         }
         }