Finish the Login page.

This commit is contained in:
lishuang
2020-06-06 00:51:11 +08:00
parent bc01b42182
commit 5b7d29de4d
3 changed files with 10 additions and 35 deletions
+1
View File
@@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.2.1",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"antd": "^4.3.1",
+1 -17
View File
@@ -1,28 +1,12 @@
.user-login {
padding-top: 150px;
.welcome {
text-align: center;
font-size: 18px;
font-size: 20px;
font-weight: bold;
padding-bottom: 40px;
}
.login-form {
.ant-input-prefix {
.anticon {
color: rgba(0, 0, 0, .25);
}
}
}
.login-form-button {
width: 100%;
}
}
+8 -18
View File
@@ -5,6 +5,8 @@ import TankComponent from "../../common/component/TankComponent";
import {Button, Col, Form, Input, message as MessageBox, Row} from 'antd';
import User from "../../common/model/user/User";
import Moon from "../../common/model/global/Moon";
import {LockOutlined, UserOutlined} from '@ant-design/icons';
interface IProps extends RouteComponentProps {
@@ -30,7 +32,6 @@ class RawLogin extends TankComponent<IProps, IState> {
}
onFinish(values: any) {
console.log('Success:', values);
@@ -57,14 +58,6 @@ class RawLogin extends TankComponent<IProps, IState> {
let that = this
const layout = {
labelCol: {span: 8},
wrapperCol: {span: 16},
};
const tailLayout = {
wrapperCol: {offset: 8, span: 16},
};
return (
<div className="user-login">
@@ -76,35 +69,32 @@ class RawLogin extends TankComponent<IProps, IState> {
</div>
<Form
{...layout}
name="basic"
initialValues={{remember: true}}
onFinish={this.onFinish.bind(this)}
onFinishFailed={this.onFinishFailed.bind(this)}
>
<Form.Item
label="Username"
name="username"
rules={[{required: true, message: 'Please input your username!'}]}
>
<Input/>
<Input size="large" placeholder="请输入用户名" prefix={<UserOutlined/>}/>
</Form.Item>
<Form.Item
label="Password"
name="password"
rules={[{required: true, message: 'Please input your password!'}]}
>
<Input.Password/>
<Input.Password size="large" placeholder="请输入密码" prefix={<LockOutlined/>}/>
</Form.Item>
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
Submit
<Form.Item>
<Button type="primary" icon={<UserOutlined/>} block={true} htmlType="submit">
</Button>
</Form.Item>
</Form>
</Form>
</Col>
</Row>