Commit 2387309f by zhanghaozhe

绑定手机号bug

parent 84bcf595
......@@ -123,7 +123,6 @@ const formikConfig = {
plat: 5
}).then(res => {
const data = res.data
if (data.errno == 200) {
if (data.data['is_set_pwd']) {
......@@ -132,8 +131,10 @@ const formikConfig = {
data: {
uid: data.data.uid
},
msg: data.data.msg
msg: data.data.msg,
stage: 'binding'
})
alert('replace')
props.history.replace(`/passport/set-password`)
}else {
location.assign(data.data['jump_url'])
......
......@@ -67,15 +67,17 @@ class Passport extends Component {
let {history, location} = this.props
let {data} = this.props.user
if (data && Object.values(data).filter(item => !!item).length) {
if(history.action === 'POP' && history.length <= 3) {
if (history.action === 'POP' && history.length <= 3) {
history.push('/')
} else {
const { from } = location.state || {from: {pathname: '/', search: ''}};
if (!(this.props.user && this.props.user.stage)) {
const from = location.state && location.state.from || {pathname: '/', search: ''};
const redirectURI = getParam('redirect')
redirectURI ? (window.location.href = redirectURI) : history.replace(from);
}
}
}
}
render() {
......
......@@ -16,11 +16,6 @@ import { connect } from "react-redux";
class SetPassword extends Component {
componentDidMount() {
// console.log(this.props.location);
}
render() {
let {values, errors, location} = this.props
let {from} = location.state || {from: {pathname: '/'}}
......@@ -75,7 +70,7 @@ const formikConfig = {
},
handleSubmit: (values, {props}) => {
let {from} = props.location.state || {from: {pathname: '/'}}
let from = props.location.state && props.location.state.from || {pathname: '/'}
if (from.pathname.includes('forgot-password')) {
forgotPasswordReset(values, props);
} else {
......@@ -129,7 +124,7 @@ function bindMobileSetPassword(values, props) {
.then(res => {
if (res.data.errno == 200) {
Toast.info('密码设置成功')
let {from} = location.state || {from: {pathname: '/'}}
let from = props.location.state && props.location.state.from || {pathname: '/'}
setTimeout(function () {
props.history.replace(from.pathname)
}, 1000)
......
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