You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.4 KiB
41 lines
1.4 KiB
import React from "react";
|
|
import {RegisterProps, RegisterState} from "./RegisterProps";
|
|
import {Input} from "../ui/InputGroup";
|
|
import {Button, Form} from 'react-bootstrap'
|
|
|
|
/**
|
|
* 注册
|
|
*/
|
|
export class Register extends React.Component<RegisterProps, RegisterState>{
|
|
|
|
constructor(props: Readonly<RegisterProps>) {
|
|
super(props)
|
|
this.state={
|
|
user:"",
|
|
password:"",
|
|
}
|
|
}
|
|
|
|
//注册
|
|
register(){
|
|
alert("您输入的用户名是"+this.state.user+",您输入的密码是:"+this.state.password);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div className="d-flex align-items-center" style={{height:window.screen.availHeight+'px'}}>
|
|
<div className="container">
|
|
<Form>
|
|
<Input name="user" type="text" desc="用户账号" value={this.state.user} onChange={(value: string)=>{this.setState({user:value})}}/>
|
|
|
|
<Input name="password" type="password" desc="用户密码" value={this.state.password} onChange={(value: string)=>{this.setState({password:value})}}/>
|
|
|
|
<Button variant="success" className="mt-3 col-2 mr-3" onClick={()=>this.register()}>注册</Button>
|
|
|
|
<Button variant="info" className="mt-3 col-2" onClick={()=>this.props.toLogin()}>返回登陆</Button>
|
|
</Form>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|