diff --git a/web/src/components/Layout/AuthLayout.tsx b/web/src/components/Layout/AuthLayout.tsx index 94d28e11..a969298d 100644 --- a/web/src/components/Layout/AuthLayout.tsx +++ b/web/src/components/Layout/AuthLayout.tsx @@ -13,7 +13,7 @@ const { Content } = Layout; // 认证布局组件,使用useRouteGuard hook进行路由鉴权 const AuthLayout: FC = () => { - const { getUserInfo, getStorageType } = useUser(); + const { getUserInfo } = useUser(); // 使用路由守卫hook处理认证和权限检查 useRouteGuard('manage'); // 自动更新面包屑导航 @@ -24,7 +24,6 @@ const AuthLayout: FC = () => { window.location.href = `/#/login`; } else { getUserInfo() - getStorageType() } }, []); diff --git a/web/src/views/OrderHistory/components/OrderDetail.tsx b/web/src/views/OrderHistory/components/OrderDetail.tsx index e4c5bf51..043254d6 100644 --- a/web/src/views/OrderHistory/components/OrderDetail.tsx +++ b/web/src/views/OrderHistory/components/OrderDetail.tsx @@ -67,8 +67,8 @@ const OrderDetail = forwardRef - - + + ); }); 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 && <> diff --git a/web/src/views/Workflow/hooks/useWorkflowGraph.ts b/web/src/views/Workflow/hooks/useWorkflowGraph.ts index 77ea56ca..88723a4d 100644 --- a/web/src/views/Workflow/hooks/useWorkflowGraph.ts +++ b/web/src/views/Workflow/hooks/useWorkflowGraph.ts @@ -972,10 +972,10 @@ export const useWorkflowGraph = ({ } else if (data.config[key] && 'defaultValue' in data.config[key] && key !== 'knowledge_retrieval') { itemConfig[key] = data.config[key].defaultValue } else if (key === 'knowledge_retrieval' && data.config[key] && 'defaultValue' in data.config[key]) { - const { knowledge_bases } = data.config[key].defaultValue + const { knowledge_bases } = data.config[key].defaultValue || {} itemConfig = { ...itemConfig, - ...data.config[key].defaultValue, + ...(data.config[key].defaultValue || {}), knowledge_bases: knowledge_bases?.map((vo: any) => { const kb_config = vo.config || { similarity_threshold: vo.similarity_threshold, strategy: vo.strategy, top_k: vo.top_k, weight: vo.weight } return { kb_id: vo.kb_id || vo.id, ...kb_config, }