import { useNavigate } from 'react-router-dom'; import { Form, Input, Button, message, Divider } from 'antd'; import { UserOutlined, LockOutlined, SafetyCertificateOutlined } from '@ant-design/icons'; import { useAuthStore } from '../stores/auth'; export default function Login() { const navigate = useNavigate(); const login = useAuthStore((s) => s.login); const loading = useAuthStore((s) => s.loading); const [messageApi, contextHolder] = message.useMessage(); const onFinish = async (values: { username: string; password: string }) => { try { await login(values.username, values.password); messageApi.success('登录成功'); navigate('/'); } catch (err: unknown) { const errorMsg = (err as { response?: { data?: { message?: string } } })?.response?.data?.message || '登录失败,请检查用户名和密码'; messageApi.error(errorMsg); } }; return (
{contextHolder} {/* 左侧品牌展示区 */}
{/* 装饰性背景元素 */}
{/* 品牌内容 */}

ERP Platform

新一代模块化企业资源管理平台

身份权限 · 工作流引擎 · 消息中心 · 系统配置

{/* 底部特性点 */}
{[ { label: '多租户架构', value: 'SaaS' }, { label: '模块化设计', value: '可插拔' }, { label: '事件驱动', value: '可扩展' }, ].map((item) => (
{item.value}
{item.label}
))}
{/* 右侧登录表单区 */}

欢迎回来

请登录您的账户以继续

} placeholder="用户名" style={{ height: 44, borderRadius: 10 }} /> } placeholder="密码" style={{ height: 44, borderRadius: 10 }} />

ERP Platform v0.1.0 · Powered by Rust + React

); }