Commit e4088969 by zhanghaozhe

老用户绑定手机号

parent c18a4e42
...@@ -24,7 +24,6 @@ class Captcha extends Component { ...@@ -24,7 +24,6 @@ class Captcha extends Component {
width: 'auto', width: 'auto',
onReady: function (instance) { onReady: function (instance) {
// 验证码一切准备就绪,此时可正常使用验证码的相关功能 // 验证码一切准备就绪,此时可正常使用验证码的相关功能
console.log(_this);
_this.setState({ _this.setState({
isReady: true isReady: true
}); });
......
...@@ -39,6 +39,9 @@ class BindingTel extends Component { ...@@ -39,6 +39,9 @@ class BindingTel extends Component {
} }
} }
componentDidMount() {
console.log(this.props.location.state)
}
render() { render() {
const { const {
...@@ -148,17 +151,23 @@ const formikConfig = { ...@@ -148,17 +151,23 @@ const formikConfig = {
} }
}) })
} else { } else {
http.post(`${API['passport-api']}/bind_mobile`, { const uid = getParam('uid')
const params = {
phone_num: values.tel, phone_num: values.tel,
phone_code: values.veriCode, phone_code: values.veriCode,
mkey: getParam('mkey'), mkey: getParam('mkey'),
area_code: '00' + props.country.num, area_code: '00' + props.country.num,
plat: 5 plat: 5,
}).then(res => { type: uid ? 1 : 2
}
if (uid) {
params.uid = uid
}
http.post(`${API['passport-api']}/bind_mobile`, params).then(res => {
const data = res.data const data = res.data
if (data.errno == 200) { if (data.errno == 200) {
const {history} = props
if (data.data['is_set_pwd']) { if (data.data['is_set_pwd']) {
const {history} = props
history.replace(`/passport/set-password`, { history.replace(`/passport/set-password`, {
user: { user: {
hasError: false, hasError: false,
...@@ -170,7 +179,15 @@ const formikConfig = { ...@@ -170,7 +179,15 @@ const formikConfig = {
} }
}) })
} else { } else {
location.assign(data.data['jump_url']) if (uid) {
const redirect = localStorage.getItem('binding_redirect')
if (redirect) {
localStorage.removeItem('binding_redirect')
history.replace(JSON.parse(redirect))
} else {
location.assign(data.data['jump_url'])
}
}
} }
......
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