Commit bc38186a by zhanghaozhe

登录

parent 5c4ab36f
......@@ -74,7 +74,7 @@ const formikConfig = {
const {props, props: {history}} = formikBag
props.accountLogin({
username, password
}).then(res => {
})/*.then(res => {
if (!res.hasError) {
let {from} = props.location.state || {from: {pathname: '/', search: ''}}
console.log(from, 'account');
......@@ -82,7 +82,7 @@ const formikConfig = {
} else {
Toast.info(res.msg, 2, null, false)
}
})
})*/
}
}
......
......@@ -65,16 +65,15 @@ class Passport extends Component {
routeWhenUserLoggedIn = () => {
let {history} = this.props
let {history,location} = this.props
let {data} = this.props.user
if (data && Object.values(data).filter(item => !!item).length) {
console.log(history);
if(history.action === 'POP' && history.length <= 3) {
console.log('push');
if(history.action === 'POP' && history.length <= 3) {
history.push('/')
}else {
console.log('go');
history.go(-1)
const {from} = location.state || {from: {pathname: '/', search: ''}}
history.replace(from)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment