mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
feat: 登陆后跳转首页
This commit is contained in:
parent
223df4ac47
commit
38f9e0aa1a
@ -206,8 +206,6 @@ class Home extends Component {
|
||||
</div>
|
||||
)
|
||||
: <HomeGuest introList={this.props.introList}/>}
|
||||
<div style={{height: '1000px'}}>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { Form, Button, Input, Icon, message } from 'antd';
|
||||
import { loginActions } from '../../reducer/modules/user';
|
||||
import { withRouter } from 'react-router'
|
||||
const FormItem = Form.Item;
|
||||
import './Login.scss'
|
||||
|
||||
@ -24,7 +25,7 @@ const changeHeight = {
|
||||
loginActions
|
||||
}
|
||||
)
|
||||
|
||||
@withRouter
|
||||
class Login extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
@ -32,6 +33,7 @@ class Login extends Component {
|
||||
|
||||
static propTypes = {
|
||||
form: PropTypes.object,
|
||||
history: PropTypes.object,
|
||||
loginActions: PropTypes.func
|
||||
}
|
||||
|
||||
@ -42,6 +44,7 @@ class Login extends Component {
|
||||
if (!err) {
|
||||
this.props.loginActions(values).then((res) => {
|
||||
if (res.payload.data.errcode == 0) {
|
||||
this.props.history.push('/');
|
||||
message.success('登录成功! ');
|
||||
} else {
|
||||
message.error(res.payload.data.errmsg);
|
||||
|
Loading…
Reference in New Issue
Block a user