Commit e4088969 by zhanghaozhe

老用户绑定手机号

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