提交 7412a366 authored 作者: 王鹏飞's avatar 王鹏飞

切换绑定修改

上级 700c61ce
...@@ -86,13 +86,13 @@ export default { ...@@ -86,13 +86,13 @@ export default {
}) })
}, },
// 绑定微信并登录 // 绑定微信并登录
bindWechat(data) { bindWechat(data, forceUpdate = 0) {
const params = Object.assign({}, this.ruleForm, data, { const params = Object.assign({}, this.ruleForm, data, {
type: 2, type: 2,
identity: 'transport', identity: 'transport',
unionid: this.unionid, unionid: this.unionid,
code: data.password, code: data.password,
forceUpdate: '0' forceUpdate // 是否强制绑定微信(0:否,1:是,默认为1)
}) })
api api
.bindWechat(params) .bindWechat(params)
...@@ -101,11 +101,8 @@ export default { ...@@ -101,11 +101,8 @@ export default {
if (code === 0) { if (code === 0) {
this.bindVisitor(this.loginSuccess(response)) this.bindVisitor(this.loginSuccess(response))
} else if (code === 1007) { } else if (code === 1007) {
this.$dialog({ // 切换绑定
confirmButtonText: '知道了', this.switchBindWechat(data)
message:
'您的手机号码已绑定其他微信号码,您可以用绑定的微信号登录后解除绑定或拨打客服电话解除绑定。解绑后再尝试绑定当前的微信号。'
})
} else { } else {
this.$dialog({ message }) this.$dialog({ message })
} }
...@@ -114,6 +111,17 @@ export default { ...@@ -114,6 +111,17 @@ export default {
error.response && this.$toast(error.response.data.message) error.response && this.$toast(error.response.data.message)
}) })
}, },
// 切换绑定
switchBindWechat(data) {
this.$dialog({
showCancelButton: true,
confirmButtonText: '切换绑定',
cancelButtonText: '绑定其他手机号',
message: '此手机号码已绑定其他微信,是否切换绑定该微信?'
}).then(() => {
this.bindWechat(data, 1)
})
},
// 登录成功 // 登录成功
loginSuccess(response, delta = 2) { loginSuccess(response, delta = 2) {
if (response.code === 0) { if (response.code === 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论