手机app的第三方登陆问题

app注册账号关联当前登录微信,随后我切换另外一个微信登录,同时切换另外一个app注册账号,此时在关联微信账号时,获取的居然时第一个微信的信息,这个是什么原因么?

plus.oauth.getServices(function (services) {

try {

auths = services;
if (!auths[type].authResult) {
    auths[type].login(function () {
        auths[type].getUserInfo(function () {
            alert(JSON.stringify(auths[type]))
            auths[type].userInfo.openid = auths[type].authResult.openid
            res(auths[type].userInfo)
        })
    }, function () {
        auths[type].userInfo.openid = auths[type].authResult.openid
        res(auths[type].userInfo)
    });
} else {
    auths[type].getUserInfo(function () {
        auths[type].userInfo.openid = auths[type].authResult.openid
        res(auths[type].userInfo)
    })
}

} catch (err) {

auths[type].getUserInfo(function () {
    auths[type].userInfo.openid = auths[type].authResult.openid
    res(auths[type].userInfo)
})
// alert('err' + err)

}
}, e => {

err(e)
});

阅读 1.6k
1 个回答

应该不会出现这样的问题,你再看看是不是哪一步流程错了。
代码没用,你获取的是微信回调的账号信息。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题