blob: 14bf6c8a92eb63dc831e9e651f75769c68daf63f [file] [log] [blame]
22301014bc4616f2025-06-03 16:59:44 +08001
2import { LockOutlined, MailOutlined } from '@ant-design/icons';
3import { Button, Checkbox, Form, Input, Flex } from 'antd';
4import { NavLink } from 'react-router';
5function Login() {
6 const onFinish = (values: unknown) => {
7 console.log('Received values of form: ', values);
8 };
9
10 return (
11 <Form
12 name="login"
13 initialValues={{ remember: true }}
14 style={{ maxWidth: 360 }}
15 onFinish={onFinish}
16 >
17 <h2>登录</h2>
18 <Form.Item
19 name="email"
20 rules={[{ required: true, message: '请输入你的账号(注册邮箱)!' }, { type: 'email', message: '请输入正确的邮箱' }]}
21 >
22 <Input prefix={<MailOutlined />} placeholder="账号(注册邮箱)" />
23 </Form.Item>
24 <Form.Item
25 name="password"
26 rules={[{ required: true, message: '请输入你的密码!' }]}
27 >
28 <Input prefix={<LockOutlined />} type="password" placeholder="密码" />
29 </Form.Item>
30 <Form.Item>
31 <Flex justify="space-between" align="center">
32 <Form.Item name="remember" valuePropName="checked" noStyle>
33 <Checkbox>自动登录</Checkbox>
34 </Form.Item>
35 <NavLink to='/forget'> 忘记密码 </NavLink>
36
37 </Flex>
38 </Form.Item>
39
40 <Form.Item>
41 <Button block type="primary" htmlType="submit">
42 登录
43 </Button>
44 <NavLink to='/register'>注册</NavLink>
45 </Form.Item>
46 </Form>
47 );
48};
49
50export default Login;