Bläddra i källkod

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

Michael Wang 3 år sedan
förälder
incheckning
49820a2c5b
1 ändrade filer med 11 tillägg och 2 borttagningar
  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: "断点续考",