Login.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. import './index.css';
  7. const {Content} = Layout;
  8. class Login extends Component {
  9. constructor() {
  10. super();
  11. this.state = {
  12. userID: ''
  13. }
  14. }
  15. getUserId = (id) => {
  16. this.setState({
  17. userID: id
  18. })
  19. };
  20. render() {
  21. return (
  22. <Layout style={{padding: '24px', zIndex: '0'}}>
  23. <Content style={{padding: '24px', minHeight: 280, background: '#fff'}}>
  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. </Content>
  34. </Layout>
  35. )
  36. }
  37. }
  38. export default Login;