From a507cc055daac6c00338642dc70f11a31fc06ef1 Mon Sep 17 00:00:00 2001 From: Hu Gang <18768366022@163.com> Date: Tue, 3 Jun 2025 14:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A3=80=E8=A7=86=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 1 + src/views/api/components/McpDrawer.vue | 24 ++++++++++++------- src/views/api/components/McpServiceDetail.vue | 2 ++ .../app/components/SelectAppTypeDialog.vue | 4 +++- .../createapp/components/AgentAppConfig.vue | 13 +++++++--- src/views/createapp/index.vue | 12 ++++++---- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 229cb6d..bf9b67a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -24,6 +24,7 @@ export default [ { rules: { '@typescript-eslint/no-explicit-any': 'off', + 'vue/multi-word-component-names': 'off', }, }, ]; diff --git a/src/views/api/components/McpDrawer.vue b/src/views/api/components/McpDrawer.vue index ecc37ea..83c8f90 100644 --- a/src/views/api/components/McpDrawer.vue +++ b/src/views/api/components/McpDrawer.vue @@ -123,7 +123,7 @@ async function onConfirm(formEl: FormInstance | undefined) { if (json) form.mcpConfig = json; await formEl.validate(async (valid) => { if (!valid) return; - const [_, res] = await api.createOrUpdateMcpService({ + const [, res] = await api.createOrUpdateMcpService({ serviceId: props.serviceId || undefined, icon: form.icon, name: form.name, @@ -132,14 +132,16 @@ async function onConfirm(formEl: FormInstance | undefined) { mcpType: form.type, }); - formEl.resetFields(); - jsonEditorRef.value.setJsonValue('{\n \n}'); - emits('success'); + if (res) { + formEl.resetFields(); + jsonEditorRef.value.setJsonValue('{\n \n}'); + emits('success'); + } }); } async function getMcpServiceDetail(serviceId: string) { - const [_, res] = await api.getMcpServiceDetail(serviceId); + const [, res] = await api.getMcpServiceDetail(serviceId); if (res) { const { icon, name, description, data, mcpType } = res.result; form.icon = icon; @@ -169,7 +171,7 @@ watch( } getMcpServiceDetail(props.serviceId); } else { - formRef.value && formRef.value.resetFields(); + if (formRef.value) formRef.value.resetFields(); setMcpConfig(form.type); } }, @@ -238,7 +240,11 @@ watch( class="form-item" > - + {{ label }} @@ -264,6 +270,8 @@ watch(