Commit bc38186a by zhanghaozhe

登录

parent 5c4ab36f
...@@ -74,7 +74,7 @@ const formikConfig = { ...@@ -74,7 +74,7 @@ const formikConfig = {
const {props, props: {history}} = formikBag const {props, props: {history}} = formikBag
props.accountLogin({ props.accountLogin({
username, password username, password
}).then(res => { })/*.then(res => {
if (!res.hasError) { if (!res.hasError) {
let {from} = props.location.state || {from: {pathname: '/', search: ''}} let {from} = props.location.state || {from: {pathname: '/', search: ''}}
console.log(from, 'account'); console.log(from, 'account');
...@@ -82,7 +82,7 @@ const formikConfig = { ...@@ -82,7 +82,7 @@ const formikConfig = {
} else { } else {
Toast.info(res.msg, 2, null, false) Toast.info(res.msg, 2, null, false)
} }
}) })*/
} }
} }
......
...@@ -65,16 +65,15 @@ class Passport extends Component { ...@@ -65,16 +65,15 @@ class Passport extends Component {
routeWhenUserLoggedIn = () => { routeWhenUserLoggedIn = () => {
let {history} = this.props let {history,location} = this.props
let {data} = this.props.user let {data} = this.props.user
if (data && Object.values(data).filter(item => !!item).length) { if (data && Object.values(data).filter(item => !!item).length) {
console.log(history); if(history.action === 'POP' && history.length <= 3) {
if(history.action === 'POP' && history.length <= 3) {
console.log('push');
history.push('/') history.push('/')
}else { }else {
console.log('go'); const {from} = location.state || {from: {pathname: '/', search: ''}}
history.go(-1)
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