refactor(home): 移除外部链接跳转功能并优化路由导航

- 移除百度链接跳转功能,改为内部路由导航到内容生成页面
- 删除无用的 isChecking 状态和 handleChatClick 处理函数
- 移除菜单项中的 externalLink 属性配置
- 简化侧边栏点击事件处理逻辑,移除外部链接检查代码
- 添加内容生成页面的路由配置
This commit is contained in:
2026-01-20 10:34:13 +08:00
parent 7f100c08ca
commit 8d6b4a4265
5 changed files with 32 additions and 27 deletions

View File

@@ -10,21 +10,11 @@ import {
GitBranch,
} from "lucide-react";
import { features, menuItems } from "../Layout/menu";
import { useState } from 'react';
import { useNavigate } from "react-router";
import { Card } from "antd";
export default function WelcomePage() {
const navigate = useNavigate();
const [isChecking, setIsChecking] = useState(false);
const handleChatClick = async () => {
if (isChecking) return; // 防止重复点击
setIsChecking(true);
window.open('https://baidu.com')
};
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100">
@@ -51,11 +41,11 @@ export default function WelcomePage() {
使
</span>
<span
onClick={handleChatClick}
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"
onClick={() => navigate("/data/content-generation")}
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"
>
<MessageSquare className="mr-2 w-4 h-4" />
</span>
</div>
</div>
@@ -89,13 +79,7 @@ export default function WelcomePage() {
{menuItems.map((item) => (
<Card
key={item.id}
onClick={() => {
if (item.externalLink) {
window.open(item.externalLink, "_blank");
return;
}
navigate(item.children ? `/data/${item.children[0].id}`: `/data/${item.id}`);
}}
onClick={() => navigate(item.children ? `/data/${item.children[0].id}`: `/data/${item.id}`)}
className="cursor-pointer hover:shadow-lg transition-all duration-200 border-0 shadow-md relative overflow-hidden group w-full md:w-[calc(50%-12px)] lg:w-[280px]"
>
<div className="text-center relative">