瀏覽代碼

fix:解决文件下载的问题

chenjiaxin 1 月之前
父節點
當前提交
f97e8d487d
共有 3 個文件被更改,包括 7 次插入2 次删除
  1. 二進制
      dist.zip
  2. 1 1
      src/utils/downloadUtil.js
  3. 6 1
      src/views/face-swap-video/index.vue

二進制
dist.zip


+ 1 - 1
src/utils/downloadUtil.js

@@ -14,7 +14,7 @@ export default {
         .toLowerCase()
         .split(".")
         .pop();
-      if (!["jpg", "jpeg", "png", "gif", "webp",'map4','mov','mp3'].includes(fileType)) {
+      if (!["jpg", "jpeg", "png", "gif", "webp",'mp4','mov','mp3'].includes(fileType)) {
         Message.error("该文件的格式不支持下载");
         return false;
       }

+ 6 - 1
src/views/face-swap-video/index.vue

@@ -193,10 +193,15 @@ export default {
     getValueByKey,
     isVideoFormat(url) {
       if (!url) return false;
-      return url.toLowerCase().endsWith(".mp4");
+      const extension = url
+        .toLowerCase()
+        .split(".")
+        .pop();
+      return["mp4", "mov",].includes(extension);
     },
     // 新增图片格式检测方法
     isImageFormat(url) {
+      if (!url) return false;
       const extension = url
         .toLowerCase()
         .split(".")