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({