import React from 'react'; import { connect } from 'dva'; import router from 'umi/router'; import store from '@/utils/store'; import { Input, Icon, Button, message } from 'antd'; import config from '@/config'; import styles from './index.less'; @connect() class Login extends React.Component { state = { username: '', password: '', }; localOnChangeUserName = e => { this.setState({ username: e.target.value }); }; localOnChangePassWord = e => { this.setState({ password: e.target.value }); }; login = () => { const { username, password } = this.state; const { dispatch } = this.props; dispatch({ type: 'global/login', payload: { userName: username, password }, }); }; render() { return (