分类整理代码,增加登陆、登出页面
parent
c241bbe5e1
commit
54170a21e8
@ -0,0 +1,109 @@
|
||||
import { Button, Checkbox, Form, Input, Row, Typography, Layout } from 'antd';
|
||||
const { Header, Footer, Sider, Content } = Layout;
|
||||
const { Title } = Typography;
|
||||
const headerStyle = {
|
||||
textAlign: 'center',
|
||||
// color: '#fff',
|
||||
height: 64,
|
||||
paddingInline: 50,
|
||||
lineHeight: '64px',
|
||||
backgroundColor: '#f5f5f5',
|
||||
};
|
||||
const contentStyle = {
|
||||
textAlign: 'center',
|
||||
minHeight: 600,
|
||||
lineHeight: '120px',
|
||||
// color: '#fff',
|
||||
// backgroundColor: '#108ee9',
|
||||
};
|
||||
const footerStyle = {
|
||||
textAlign: 'center',
|
||||
// color: '#fff',
|
||||
// backgroundColor: '#7dbcea',
|
||||
};
|
||||
const onFinish = (values) => {
|
||||
console.log('Success:', values);
|
||||
};
|
||||
const onFinishFailed = (errorInfo) => {
|
||||
console.log('Failed:', errorInfo);
|
||||
};
|
||||
const Login = () => (
|
||||
<Layout>
|
||||
<Header style={headerStyle}>
|
||||
<Title>Global Highlights Hub</Title>
|
||||
</Header>
|
||||
<Content style={contentStyle}>
|
||||
<Row justify="center" align="middle" style={{minHeight: 600}}>
|
||||
<Form
|
||||
name="basic"
|
||||
labelCol={{
|
||||
span: 8,
|
||||
}}
|
||||
wrapperCol={{
|
||||
span: 16,
|
||||
}}
|
||||
style={{
|
||||
maxWidth: 600,
|
||||
}}
|
||||
initialValues={{
|
||||
remember: true,
|
||||
}}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
<Form.Item
|
||||
label="Username"
|
||||
name="username"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input your username!',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Password"
|
||||
name="password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input your password!',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.Password />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="remember"
|
||||
valuePropName="checked"
|
||||
wrapperCol={{
|
||||
offset: 8,
|
||||
span: 16,
|
||||
}}
|
||||
>
|
||||
<Checkbox>Remember me</Checkbox>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
wrapperCol={{
|
||||
offset: 8,
|
||||
span: 16,
|
||||
}}
|
||||
>
|
||||
<Button type="primary" htmlType="submit">
|
||||
Submit
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Row>
|
||||
</Content>
|
||||
<Footer style={footerStyle}>Footer</Footer>
|
||||
</Layout>
|
||||
|
||||
);
|
||||
export default Login;
|
@ -0,0 +1,42 @@
|
||||
import { Button, Checkbox, Form, Input, Row, Typography, Layout } from 'antd';
|
||||
const { Header, Footer, Sider, Content } = Layout;
|
||||
const { Title } = Typography;
|
||||
const headerStyle = {
|
||||
textAlign: 'center',
|
||||
// color: '#fff',
|
||||
height: 64,
|
||||
paddingInline: 50,
|
||||
lineHeight: '64px',
|
||||
backgroundColor: '#f5f5f5',
|
||||
};
|
||||
const contentStyle = {
|
||||
textAlign: 'center',
|
||||
minHeight: 600,
|
||||
lineHeight: '120px',
|
||||
// color: '#fff',
|
||||
// backgroundColor: '#108ee9',
|
||||
};
|
||||
const footerStyle = {
|
||||
textAlign: 'center',
|
||||
// color: '#fff',
|
||||
// backgroundColor: '#7dbcea',
|
||||
};
|
||||
const onFinish = (values) => {
|
||||
console.log('Success:', values);
|
||||
};
|
||||
const onFinishFailed = (errorInfo) => {
|
||||
console.log('Failed:', errorInfo);
|
||||
};
|
||||
const SignOut = () => (
|
||||
<Layout>
|
||||
<Header style={headerStyle}>
|
||||
<Title>Global Highlights Hub</Title>
|
||||
</Header>
|
||||
<Content style={contentStyle}>
|
||||
See you.
|
||||
</Content>
|
||||
<Footer style={footerStyle}>Footer</Footer>
|
||||
</Layout>
|
||||
|
||||
);
|
||||
export default SignOut;
|
Loading…
Reference in New Issue