瀏覽代碼

修复报错

wyling 3 年之前
父節點
當前提交
578202e0ff
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/views/collection/index.vue

+ 6 - 4
src/views/collection/index.vue

@@ -123,10 +123,12 @@ const useQuestionList = (type: CollectionAndWrongType.type) => {
     collectionList.value = collectionListRes.rows;
     total.value = collectionListRes.total;
     const ids = collectionListRes.rows.map((item) => item.questionId);
-    const questions = await getQuestionInfoByIds({
-      ids,
-    });
-    questionList.value = questions.rows;
+    if (ids.length > 0) {
+      const questions = await getQuestionInfoByIds({
+        ids,
+      });
+      questionList.value = questions.rows;
+    }
   };
 
   const finished = computed(() => {