Browse Source

数据检查:fix error handle

Michael Wang 3 năm trước cách đây
mục cha
commit
5b7e091573
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 8 2
      src/features/admin/confirmPaper/ConfirmPaper.vue

+ 8 - 2
src/features/admin/confirmPaper/ConfirmPaper.vue

@@ -335,8 +335,14 @@ async function saveStudentAnswer() {
     ? // 数据检查
       "/admin/exam/check/answer/save"
     : `/admin/exam/check/student/save`;
-  await httpApp.post(url, form).catch(() => message.error("保存失败"));
-  void message.success("保存成功");
+  const res = await httpApp
+    .post(url, form)
+    .catch(() => message.error("保存失败-接口调用失败"));
+  if (!res.data) {
+    void message.error("保存失败,请刷新页面。");
+  } else {
+    void message.success("保存成功");
+  }
 
   if (setting.studentIds.length === 0) {
     void message.success("所有考生已处理完毕。");