From 651c888579b8b37aafe02b608ac1a4bb4a5a36de Mon Sep 17 00:00:00 2001
From: user1 <10901603+no-distractions1@user.noreply.gitee.com>
Date: 星期二, 25 六月 2024 16:06:43 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/components/examinations/index.vue |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue
index 98120c7..eddf0e0 100644
--- a/src/components/examinations/index.vue
+++ b/src/components/examinations/index.vue
@@ -561,7 +561,7 @@
   },
   mounted() {
     this.getCollectIdList();
-    this.getErrorList()
+    this.getErrorList();
   },
   methods: {
     // 鏁扮粍杞负瀛楃涓叉柟娉�
@@ -621,7 +621,7 @@
     },
     // 鎵规敼棰樼洰  (缁冧範,鎴戠殑鍋氶,鎴戠殑鏀惰棌妯″紡涓�)
     handleQuestion() {
-      let errorId = []
+      let errorId = [];
       const list = this.cardData;
       for (let index = 0; index < list.length; index++) {
         const item = list[index];
@@ -665,36 +665,38 @@
               }
             }
           }
-          if(citem.isRight == false) {
-            errorId.push(citem.id)
+          if (citem.isRight == false) {
+            errorId.push(citem.id);
           }
         }
       }
       this.cardData = list;
-      let oldErrodId = this.allError.find(item => item.type == this.sourceType).errorList
+      let oldErrodId = this.allError.find(
+        (item) => item.type == this.sourceType
+      ).errorList;
       for (let index = 0; index < errorId.length; index++) {
         const item = errorId[index];
-        if(oldErrodId.indexOf(item == -1)) {
-          oldErrodId.push(item)
+        if (oldErrodId.indexOf(item == -1)) {
+          oldErrodId.push(item);
         }
       }
       for (let cindex = 0; cindex < this.allError.length; cindex++) {
         const citem = this.allError[cindex];
-        if(citem.type == this.sourceType) citem.errorList = oldErrodId
+        if (citem.type == this.sourceType) citem.errorList = oldErrodId;
       }
       this.MG.identity
         .setUserKey({
           setKeyRequests: [
             {
-              domain: 'errorData',
+              domain: "errorData",
               key: this.config.activeBook.bookId,
-              value: JSON.stringify(this.allError)
-            }
-          ]
+              value: JSON.stringify(this.allError),
+            },
+          ],
         })
         .then((res) => {
-          console.log('閿欓宸蹭繚瀛�',this.allError)
-        })
+          console.log("閿欓宸蹭繚瀛�", this.allError);
+        });
     },
     getParentWithClass(element, className) {
       while (element.parentElement) {
@@ -792,6 +794,8 @@
     },
     // 鑾峰彇鏀惰棌id鍒楄〃
     getCollectIdList() {
+      const token = localStorage.getItem("token");
+      if (!token) return false;
       this.MG.identity
         .getUserKey({
           domain: "collectData",
@@ -821,6 +825,8 @@
     },
     // 鑾峰彇閿欓id鍒楄〃
     getErrorList() {
+      const token = localStorage.getItem("token");
+      if (!token) return false;
       this.MG.identity
         .getUserKey({
           domain: "errorData",
@@ -841,7 +847,8 @@
               ).errorList;
             }
           } catch (error) {}
-        });
+        })
+        .catch(() => {});
     },
   },
 };

--
Gitblit v1.9.1