浏览代码

feat: 完善验证逻辑

cuiyalong 10 月之前
父节点
当前提交
0d2a5d94dc
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      frontend/src/views/CodeList.vue

+ 11 - 2
frontend/src/views/CodeList.vue

@@ -534,9 +534,18 @@ const tableEvents = {
         }
         VerifySpiderConfig(mark).then(r => {
             console.log("验证爬虫结果", r)
+            if (r.err === 1 && r.ret) {
+                verifySpiderDialog.value.dialogVisible = true
+                verifySpiderDialog.value.formData = r.ret
+            } else {
+                return ElMessage({
+                    message: r.msg || '验证异常',
+                    type: 'error',
+                    duration: 3000,
+                })
+            }
+        }).finally(() => {
             loading.value = false
-            verifySpiderDialog.value.dialogVisible = true
-            verifySpiderDialog.value.formData = r
         })
     },
     handleSubmit(index, row) {