Parcourir la source

营造一种进入断点续考的进度提示

Michael Wang il y a 3 ans
Parent
commit
49820a2c5b
1 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. 11 2
      src/features/UserLogin/useExamInProgress.ts

+ 11 - 2
src/features/UserLogin/useExamInProgress.ts

@@ -112,11 +112,20 @@ export async function checkExamInProgress(): Promise<boolean> {
       }
     } else if (content) {
       const msg = $message.info("正在进入断点续考...");
-      void router
+      store.increaseGlobalMaskCount("checkExamInProgress");
+      store.spinMessage = "正在进入断点续考...";
+      await new Promise((res) => setTimeout(res, 1.5 * 1000));
+      await router
         .push(
           `/online-exam/exam/${content.examId}/examRecordData/${content.examRecordDataId}/order/1`
         )
-        .then(() => msg.destroy());
+        .then(() => msg.destroy())
+        .finally(() => {
+          setTimeout(
+            () => store.decreaseGlobalMaskCount("checkExamInProgress"),
+            3 * 1000
+          );
+        });
       logger({
         cnl: ["local", "server"],
         key: "断点续考",