import React, { Component } from 'react';
import { Route, Switch, Redirect, withRouter } from 'react-router-dom';
import 'antd/dist/antd.css';

// 登录注册
import Login from './pages/login/Login';
import Register from './pages/register/Register';
import ChangePassword from './pages/login/ChangePassword';
import Consultation from './pages/scheduling/Consultation';
import CommonComponent from './pages/commoncomponent/CommonComponent';
import LimitsControl from './pages/limitscontrol/limitscontrol';
import VerifyLogin from './pages/login/VerifyLogin'; // 校验登录

//自定义组件SiderDemo
class LoginRegister extends Component {
    render() {
        return (
            <div>
                <Switch>
                    <Route exact key="Login" path="/Login" component={Login}></Route>
                    <Route exact key="ChangePassword" path="/ChangePassword" component={ChangePassword}></Route>
                    <Route exact key="Register" path="/Register" component={Register}></Route>
                    <Route exact key="Consultation" path="/Consultation" component={Consultation}></Route>
                    <Route exact key="CommonComponent" path="/99010001" component={CommonComponent}></Route>
                    <Route exact key="LimitsControl" path="/limitcontrol" component={LimitsControl}></Route>
                    {/* http://127.0.0.1:3000/#/verify-login?ticket=3094830298409238409382409832094830928409324 */}
                    <Route exact key="VerifyLogin" path="/verify-login" component={VerifyLogin}></Route>
                    <Route path='/' exact render={() => (
                        <Redirect to={"/login"} />
                    )} />
                </Switch>
            </div>
        )
    }
};

//输出组件
export default withRouter(LoginRegister);

