成功proxy dev

This commit is contained in:
2020-01-02 05:33:26 +08:00
parent 348c6908d3
commit a5bb450d66
10 changed files with 233 additions and 63 deletions

View File

@@ -1,16 +1,18 @@
import React from 'react';
import axios from 'axios';
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button } from 'antd';
import './App.css';
import SiderConfig from './siderConfig';
import Login from './login';
const { Option } = Select;
const App = () => (
<>
<SiderConfig>
</SiderConfig>
</>
<Login ></Login>
);
export default App;

8
web/src/login.css Normal file
View File

@@ -0,0 +1,8 @@
.login-input {
margin-bottom: 10px;
}
.login-button {
margin-top: 40px;
width: 120px;
}

43
web/src/login.js Normal file
View File

@@ -0,0 +1,43 @@
import React from 'react';
import axios from 'axios';
import './login.css';
import { TreeSelect, Row, Col, Input, Layout, Button } from 'antd';
class Login extends React.Component {
onClick = (e) => {
var user = this.refs["login-user"].input.value
var pwd = this.refs["login-passwd"].input.value
console.log(user, pwd);
axios.get("/api/login").then(value => {
console.log(value)
});
}
render() {
return (
<Layout style={{ minHeight: "100vh" }}>
<div style={{ marginTop: "40vh" }}>
<Row className="login-input" type="flex" justify="center">
<Input ref="login-user" placeholder="Basic usage" style={{ width: "50vh" }} />
</Row>
<Row className="login-input" type="flex" justify="center">
<Input ref="login-passwd" placeholder="Basic usage" style={{ width: "50vh" }} />
</Row>
<Row className="login-input" type="flex" justify="center">
<Button className="login-button" onClick={this.onClick}>登录</Button>
</Row>
<Row className="login-input" type="flex" justify="center">
<Button className="login-button">登录</Button>
</Row>
</div>
</Layout>
)
}
}
export default Login;

View File

@@ -45,12 +45,12 @@ class SiderConfig extends React.Component {
<Header style={{ background: '#fff', padding: 0, }}>
<Row type="flex" justify="end">
<Col span={4}><Button type="primary" style={{width: '100px',}}>登录</Button></Col>
<Col span={4}><Button type="primary" style={{width: '100px',}}>退出</Button></Col>
</Row>
</Header >
<Content style={{ margin: '0 16px' }}>
<Breadcrumb style={{ margin: '16px 0' }}>
<Breadcrumb style={{ margin: '8px 0' }}>
<Breadcrumb.Item>User</Breadcrumb.Item>
<Breadcrumb.Item>Bill</Breadcrumb.Item>
</Breadcrumb>