import { DashboardOutlined, LockOutlined, SafetyCertificateOutlined, SettingOutlined, UserOutlined, } from '@ant-design/icons' import { App, Button, Form, Input } from 'antd' import { useState } from 'react' import { useNavigate } from 'react-router' import { loginAdmin } from '@/services/admin' import { setAdminSession } from '@/utils/admin-auth' type LoginForm = { username: string password: string } const brandFeatures = [ { icon: , title: '运营看板', desc: '订单、打手、财务数据一目了然', }, { icon: , title: '权限管控', desc: '按角色开放操作,操作可审计', }, { icon: , title: '灵活配置', desc: '平台、规则、费率在线可调', }, ] export default function AdminLoginPage() { const navigate = useNavigate() const { message } = App.useApp() const [loading, setLoading] = useState(false) async function submitLogin(values: LoginForm) { setLoading(true) try { const response = await loginAdmin({ username: values.username.trim(), password: values.password.trim(), }) setAdminSession(response.data.token, response.data.expiresAt, response.data.user) message.success('登录成功') navigate('/admin/dashboard', { replace: true }) } catch (error) { message.error(error instanceof Error ? error.message : '后台登录失败') } finally { setLoading(false) } } return (
{/* 品牌信息区:移动端隐藏 */} {/* 登录表单区 */}
{/* 移动端精简品牌栏 */}
Order Site Admin

运营后台登录

使用账号密码进入后台,并按角色开放不同操作权限

layout="vertical" requiredMark={false} onFinish={submitLogin}> } placeholder="输入账号" autoComplete="username" /> } placeholder="输入密码" autoComplete="current-password" />
仅限授权运营人员访问
) }