From dd314025bd964d4414c0e02bbe3086cade7429d4 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 20 Jan 2026 09:39:33 +0800 Subject: [PATCH] =?UTF-8?q?```=20refactor(home):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=AF=B9=E8=AF=9D=E5=8A=9F=E8=83=BD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除接口连通性检查逻辑 - 直接使用 window.open 打开百度链接 - 简化按钮点击事件处理 - 更新按钮显示文案为"内容生成" - 移除数据智能编排功能入口 ``` --- frontend/src/pages/Home/Home.tsx | 49 ++------------------------------ 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/frontend/src/pages/Home/Home.tsx b/frontend/src/pages/Home/Home.tsx index 32119b9..e9e525a 100644 --- a/frontend/src/pages/Home/Home.tsx +++ b/frontend/src/pages/Home/Home.tsx @@ -18,50 +18,12 @@ export default function WelcomePage() { const navigate = useNavigate(); const [isChecking, setIsChecking] = useState(false); - // 检查接口连通性的函数 - const checkDeerFlowDeploy = async (): Promise => { - try { - const response = await fetch('/deer-flow-backend/config', { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - timeout: 5000, // 5秒超时 - cache: 'no-store' - }); - - // 检查 HTTP 状态码在 200-299 范围内 - if (response.ok) { - return true; - } - } catch (error) { - console.error('接口检查失败:', error); - } - return false; - }; - const handleChatClick = async () => { if (isChecking) return; // 防止重复点击 setIsChecking(true); - try { - const isDeerFlowDeploy = await checkDeerFlowDeploy(); - - if (isDeerFlowDeploy) { - // 接口正常,执行原有逻辑 - window.location.href = "/chat"; - } else { - // 接口异常,使用 navigate 跳转 - navigate("/chat"); - } - } catch (error) { - // 发生错误时也使用 navigate 跳转 - console.error('检查过程中发生错误:', error); - navigate("/chat"); - } finally { - setIsChecking(false); - } + window.open('https://baidu.com') }; return ( @@ -93,14 +55,7 @@ export default function WelcomePage() { className="cursor-pointer rounded px-4 py-2 inline-flex items-center bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white shadow-lg disabled:opacity-50 disabled:cursor-not-allowed" > - {isChecking ? '检查中...' : '对话助手'} - - navigate("/orchestration")} - className="cursor-pointer rounded px-4 py-2 inline-flex items-center bg-gradient-to-r from-orange-600 to-amber-600 hover:from-orange-700 hover:to-amber-700 text-white shadow-lg" - > - 数据智能编排 - + 内容生成