Commit 2387309f by zhanghaozhe

绑定手机号bug

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