成功proxy dev
This commit is contained in:
@@ -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
8
web/src/login.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.login-input {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.login-button {
|
||||
margin-top: 40px;
|
||||
width: 120px;
|
||||
}
|
||||
43
web/src/login.js
Normal file
43
web/src/login.js
Normal 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;
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user