Commit 00abbd32 authored by Morson's avatar Morson

新用户登录手机号绑定不通过问题修复

parent ee3fb5c7
......@@ -67,6 +67,7 @@ export default {
methods: {
// 微信授权用户信息
getUserProfile() {
debugger
var that = this
if(uni.getUserProfile) {
// 每次触发 uni.getUserProfile 均会弹出授权窗口,用户授权后可成功获取用户信息
......@@ -125,43 +126,51 @@ export default {
signupLogin(e) {
var that = this
if (!e || !e.detail || e.detail.errMsg.indexOf('user deny') > -1) {
uni.showModal({
title: '提示',
showCancel: false,
content: '用户未授权不能完成注册'
});
} else if(!e.detail.errMsg && e.detail.encryptedData && e.detail.iv) {
let params = {
nickname: app.globalData.authUserInfo.nickName,
avatar: app.globalData.authUserInfo.avatarUrl,
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
}
login.appLogin().then(res => {
params.code = res.code
return login.signup(params);
}).then(res => {
uni.hideLoading()
if (res) {
that.setUserData(res.data)
that.goBackPage()
} else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus(false)
if(e && e.detail) {
if(e.detail.errMsg.indexOf('user deny') > -1) {
uni.showModal({
title: '提示',
showCancel: false,
content: '用户未授权不能完成注册'
});
} else if(e.detail.encryptedData && e.detail.iv) {
let params = {
nickname: app.globalData.authUserInfo.nickName,
avatar: app.globalData.authUserInfo.avatarUrl,
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
}
}).catch(res => {
uni.hideLoading()
this.setLoginStatus(false)
})
login.appLogin().then(res => {
params.code = res.code
return login.signup(params);
}).then(res => {
uni.hideLoading()
if (res) {
that.setUserData(res.data)
that.goBackPage()
} else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus(false)
}
}).catch(res => {
uni.hideLoading()
this.setLoginStatus(false)
})
} else {
uni.showModal({
title: '提示',
showCancel: false,
content: e.detail.errMsg
});
}
} else {
uni.showModal({
title: '提示',
showCancel: false,
content: e.detail.errMsg || '授权失败,请重新授权'
content: '授权失败,请重新授权'
});
}
},
......
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