Login.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React, {Component} from 'react';
  2. import LoginInput from './LoginInput';
  3. import CloudConfig from "./CloudConfig";
  4. import AccountConfig from "./AccountConfig";
  5. import {Layout} from 'antd';
  6. const {Content} = Layout;
  7. class Login extends Component {
  8. constructor() {
  9. super();
  10. this.state = {
  11. userID: ''
  12. }
  13. }
  14. getUserId = (id) => {
  15. this.setState({
  16. userID: id
  17. })
  18. };
  19. render() {
  20. return (
  21. <Layout style={{padding: '24px', zIndex: '0'}}>
  22. <Content style={{padding: '24px', minHeight: 280, background: '#fff'}}>
  23. <div>
  24. {
  25. this.props.match.params.setting ?
  26. this.props.match.params.setting === 'account' ?
  27. <AccountConfig history={this.props.history}/>
  28. :
  29. <CloudConfig userID={this.state.userID} history={this.props.history}/>
  30. :
  31. <LoginInput history={this.props.history} getUserId={this.getUserId}/>
  32. }
  33. </div>
  34. </Content>
  35. </Layout>
  36. )
  37. }
  38. }
  39. export default Login;