Explorar o código

fix:解决文件下载的问题

chenjiaxin hai 1 mes
pai
achega
f97e8d487d
Modificáronse 3 ficheiros con 7 adicións e 2 borrados
  1. BIN=BIN
      dist.zip
  2. 1 1
      src/utils/downloadUtil.js
  3. 6 1
      src/views/face-swap-video/index.vue

BIN=BIN
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(".")