7.0.0版本小程序授权登录使用其他手机号登录无效 您所在的位置:网站首页 vivo官网怎么退出当前手机号登录 7.0.0版本小程序授权登录使用其他手机号登录无效

7.0.0版本小程序授权登录使用其他手机号登录无效

2024-01-23 14:35| 来源: 网络整理| 查看: 265

- 当前 Bug 的表现(可附上截图)

- 预期表现

体验版本小程序授权登录切换手机号可以登录对应手机的界面,实际只能登录原来绑定手机号的账号

- 复现路径

体验版本小程序授权登录切换手机号可以登录对应手机的界面,实际只能登录原来绑定手机号的账号

- 提供一个最简复现 Demo

getPhoneNumber: function(e) {

if (e.detail.errMsg === 'getPhoneNumber:ok') { //用户同意授权

this.setData({

phoneInfo: e.detail

})

this.login()

} else { //用户拒绝授权

console.log(199)

return;

//用户按了拒绝按钮

}

},

login: function(e) {

let that = this

wx.login({

success(res) {

if (res.code) {

wxGetData({

api: 'weixin/xcxLogin', //登录接

data: {

code: res.code,

encryptedData: that.data.phoneInfo.encryptedData,

iv: that.data.phoneInfo.iv

}

}).then(res => {

if (!res.data || res.data.code != '0') {

wx.hideLoading();

wx.showModal({

title: '提示',

content: '无法登录,请重试',

showCancel: false

})

return;

}

let userInfo = res.data.member

wx.setStorageSync('token', res.data.data.access_token)

wx.setStorageSync('userInfo', userInfo)

wx.navigateBack();

})

} else {

console.log('登录失败!' + res.errMsg)

}

}

})

}



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有