From 1e13a6e36902da990f78c4ed0f3d85a00a8b2309 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 11 Sep 2025 17:53:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20sq?= =?UTF-8?q?lbot=E8=AE=BE=E7=BD=AE=E7=82=B9=E5=87=BB=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E4=BC=9A=E5=85=B3=E9=97=AD=E6=8A=BD=E5=B1=89=E5=B9=B6=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E4=BD=86=E6=8F=90=E7=A4=BA=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=85=B3=E4=BA=8E=E6=A0=A1=E9=AA=8C=E7=9A=84=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/parameter/third-party/ThirdEdit.vue | 14 +++++++++++--- .../views/system/parameter/third-party/index.vue | 10 +++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/system/parameter/third-party/ThirdEdit.vue b/core/core-frontend/src/views/system/parameter/third-party/ThirdEdit.vue index 2d2d695b79..00aa5b6f26 100644 --- a/core/core-frontend/src/views/system/parameter/third-party/ThirdEdit.vue +++ b/core/core-frontend/src/views/system/parameter/third-party/ThirdEdit.vue @@ -110,19 +110,27 @@ const closeLoading = () => { loadingInstance.value?.close() } -const validateHandler = () => { +const validateHandlerOnly = () => { let url = `${ state.form.domain.endsWith('/') ? state.form.domain : state.form.domain + '/' }api/v1/system/assistant/info/${state.form.id}` fetch(url) - .then(response => response.json()) + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok') + } + return response.json() + }) .then(() => { state.form.valid = true ElMessage.success(t('datasource.validate_success')) }) .catch(() => { + ElMessage.error(t('data_source.verification_failed')) state.form.enabled = false state.form.valid = false + }) + .finally(() => { save() }) } @@ -158,7 +166,7 @@ defineExpose({