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 classnames from 'classnames';
  6. import {FormattedMessage} from 'react-intl';
  7. import {Layout} from 'antd';
  8. import './index.css';
  9. const {Content} = Layout;
  10. class Login extends Component {
  11. constructor() {
  12. super();
  13. this.state = {
  14. userID: ''
  15. }
  16. }
  17. getUserId = (id) => {
  18. this.setState({
  19. userID: id
  20. })
  21. };
  22. render() {
  23. return (
  24. <Layout style={{padding: '24px', zIndex: '0'}}>
  25. <Content className={classnames('content', {'account': this.props.match.params.setting === 'account'})}>
  26. {
  27. this.props.match.params.setting ?
  28. this.props.match.params.setting === 'account' ?
  29. <AccountConfig history={this.props.history}/>
  30. :
  31. <CloudConfig userID={this.state.userID} history={this.props.history}/>
  32. :
  33. <LoginInput history={this.props.history} getUserId={this.getUserId}/>
  34. }
  35. </Content>
  36. </Layout>
  37. )
  38. }
  39. }
  40. export default Login;