From e06a0dadbf1388969cde5d2f4bf789dc26407aa6 Mon Sep 17 00:00:00 2001 From: soul <1041707577@qq.com> Date: Thu, 14 Mar 2024 11:01:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=88=86=E7=B1=BB/=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectTab/AddInterfaceModal.svelte | 17 ++++++++--------- .../type/components/ProjectTab/Interface.svelte | 15 +++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/routes/type/components/ProjectTab/AddInterfaceModal.svelte b/src/routes/type/components/ProjectTab/AddInterfaceModal.svelte index 826dae0..4c06dc6 100644 --- a/src/routes/type/components/ProjectTab/AddInterfaceModal.svelte +++ b/src/routes/type/components/ProjectTab/AddInterfaceModal.svelte @@ -28,16 +28,15 @@ try { toast.push('正在获取接口信息...', toastTheme.success); - const interfaceDataItem = await invoke>( - 'get_interface_detail', - { - data: { - token, - source_path: $sourcePath, - interface_id: Number(form.interface_id) - } + const interfaceDataItem = await invoke< + SuccessResponse<{ interface_data: InterfaceDataItem; ts: string }> + >('get_interface_detail', { + data: { + token, + source_path: $sourcePath, + interface_id: Number(form.interface_id) } - ).then((res) => res.data); + }).then((res) => res.data.interface_data); if (isCategoryExist(interfaceDataItem.catid, categories)) { toast.push(`接口所在分类已存在`, toastTheme.success); diff --git a/src/routes/type/components/ProjectTab/Interface.svelte b/src/routes/type/components/ProjectTab/Interface.svelte index dbd691b..d605f7d 100644 --- a/src/routes/type/components/ProjectTab/Interface.svelte +++ b/src/routes/type/components/ProjectTab/Interface.svelte @@ -24,13 +24,16 @@ async function preview(interface_id: number) { toast.push('正在获取接口信息...', toastTheme.success); - await invoke>('get_interface_detail', { - data: { - token, - source_path: $sourcePath, - interface_id + await invoke>( + 'get_interface_detail', + { + data: { + token, + source_path: $sourcePath, + interface_id + } } - }) + ) .then((res) => { $PreviewModalOpen = true; $PreviewModalContent = res.data.ts;