Skip to content

Commit 284e4c2

Browse files
author
chenghao
committed
fix history push
1 parent 4ec7f18 commit 284e4c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/pages/Login.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Login extends React.Component {
1616
}
1717
componentWillReceiveProps(nextProps) {
1818
const { auth: nextAuth = {} } = nextProps;
19-
const { router } = this.props;
19+
const { history } = this.props;
2020
if (nextAuth.data && nextAuth.data.uid) { // 判断是否登陆
2121
localStorage.setItem('user', JSON.stringify(nextAuth.data));
22-
router.push('/');
22+
history.push('/');
2323
}
2424
}
2525
handleSubmit = (e) => {

0 commit comments

Comments
 (0)