diff --git a/web/src/views/ToolManagement/components/InnerToolModal.tsx b/web/src/views/ToolManagement/components/InnerToolModal.tsx index 691a9cdf..d3912ced 100644 --- a/web/src/views/ToolManagement/components/InnerToolModal.tsx +++ b/web/src/views/ToolManagement/components/InnerToolModal.tsx @@ -60,25 +60,23 @@ const InnerToolModal = forwardRef(({ ...values.config, } } as any) - .then(() => { - handleClose() - message.success(t('common.saveSuccess')) - refreshTable() + .then((res: any) => { + message.success(t('common.saveSuccess')); + testConnection(res.tool_id || editVo?.id) + .finally(() => { + setLoading(false); + handleClose(); + refreshTable() + }) + }) + .catch(() => { + setLoading(false); }) }) .catch((err) => { console.log('err', err) }); } - const handleTestConnection = () => { - testConnection(editVo.id) - .then(() => { - message.success(t('tool.testConnectionSuccess')); - }) - .finally(() => { - refreshTable() - }) - }; // 暴露给父组件的方法 useImperativeHandle(ref, () => ({ @@ -91,12 +89,9 @@ const InnerToolModal = forwardRef(({ title={`${editVo.name} ${t('tool.config')}`} open={visible} onCancel={handleClose} + okText={t('tool.saveAndTest')} + onOk={handleSave} confirmLoading={loading} - footer={[ - , - , - , - ]} > {editVo?.config_data?.tool_class && config && <>