diff --git a/.gitignore b/.gitignore index e988efe..ae781fe 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ tsconfig.tsbuildinfo # AI .clinerules + +.pnpm-store \ No newline at end of file diff --git a/src/layouts/modules/header/components/UserAvatar.tsx b/src/layouts/modules/header/components/UserAvatar.tsx index 2a203e2..baac0b1 100644 --- a/src/layouts/modules/header/components/UserAvatar.tsx +++ b/src/layouts/modules/header/components/UserAvatar.tsx @@ -28,6 +28,8 @@ const UserAvatar = memo(() => { function onClick({ key }: { key: string }) { if (key === '1') { logout(); + } else if (key === '2') { + navigate('/'); } else { navigate('/user-center'); } @@ -50,6 +52,18 @@ const UserAvatar = memo(() => { ) }, + { + key: '2', + label: ( +
+ + 返回首页 +
+ ) + }, { type: 'divider' }, diff --git a/src/pages/(blank)/login/modules/Header.tsx b/src/pages/(blank)/login/modules/Header.tsx index d22bb30..631e661 100644 --- a/src/pages/(blank)/login/modules/Header.tsx +++ b/src/pages/(blank)/login/modules/Header.tsx @@ -5,15 +5,30 @@ import { ThemeSchemaSwitch } from '@/features/theme'; const Header = memo(() => { const { t } = useTranslation(); + const navigate = useNavigate(); + + const handleBackToWelcome = () => { + navigate('/'); + }; return (
- + + ← 返回首页 + + +
+ - + +
{ + const isLogin = useAppSelector(getIsLogin); + const navigate = useNavigate(); + + const handleEnter = () => { + if (isLogin) { + navigate(globalConfig.homePath); + } else { + navigate('/login'); + } + }; + + const handleViewDocs = () => { + window.open('https://admin-docs.chiko.store', '_blank'); + }; -const Index = () => { return ( - +
+
+
+
+ + + ChikoAdmin + +
+ + 一个基于 React 19、Vite、TypeScript、Ant Design 和 UnoCSS 的清新优雅的中后台模版 + +
+ +
+ + {isLogin ? '进入后台管理' : '立即登录体验'} + + + 查看文档 + +
+ + + + 项目简介 + + + ChikoAdmin 是一个现代化的中后台管理系统模板,采用最新的技术栈和最佳实践构建。项目使用 Monorepo 架构, + 提供了完整的开发工具链和丰富的功能组件。采用 MSW (Mock Service Worker) 提供强大的 Mock 数据方案, + 让前端开发不再依赖后端接口。 + + + + + + 技术栈 + + + {techStacks.map(tech => ( + + {tech.name} + {tech.version} + + ))} + + + + + + 主要特性 + + + {features.map((feature, index) => ( + + + + {feature.title} + + + {feature.description} + + + + ))} + + + + + + 环境要求 + + + +
+
+ 📦 +
+
+ + Node.js + + {'>= 18.0.0'} +
+
+
+ +
+
+ 🚀 +
+
+ + pnpm + + {'>= 8.0.0'} +
+
+
+
+
+ + + + +
+
); }; -export default Index; +export default WelcomePage;