configworker/web/src/login.js
2020-01-02 05:33:26 +08:00

43 lines
1.4 KiB
JavaScript

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;