Ver código fonte

续传的bug修复

刘洋 9 meses atrás
pai
commit
7c46e634aa
1 arquivos alterados com 3 adições e 4 exclusões
  1. 3 4
      src/features/ImageDownload/ImageDownload.vue

+ 3 - 4
src/features/ImageDownload/ImageDownload.vue

@@ -25,6 +25,7 @@ const router = useRouter();
 import { countStudents, getPackages, getStudents } from "@/api/api";
 import { httpApp } from "@/plugins/axiosApp";
 import mustache from "mustache";
+import { cloneDeep } from "lodash";
 
 function millisecondsToHMS(milliseconds: number) {
   let seconds = Math.floor((milliseconds / 1000) % 60);
@@ -279,7 +280,6 @@ const studentHandler = async (student: any, obj: any) => {
         }
       }
     }
-
     if (
       resultImgList.length === sheetUrlsLength &&
       (config.pdf == "2" || config.pdf == "3")
@@ -308,7 +308,6 @@ const studentHandler = async (student: any, obj: any) => {
         `/pdfs/${store.env.examId}/${student.subjectCode}/${pdfName}.pdf`,
       ]);
     }
-
     // 下载完一个学生
     obj.curTasksLength--;
     obj.id = student.id;
@@ -365,8 +364,8 @@ const doneTenStudents = () => {
       timer = null;
     }
   };
-
-  requestStack.forEach((student: any) => {
+  let requestStackClone = cloneDeep(requestStack);
+  requestStackClone.forEach((student: any) => {
     studentHandler(student, recordManager);
   });
   return new Promise((rs, rj) => {