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)
});
应该不会出现这样的问题,你再看看是不是哪一步流程错了。
代码没用,你获取的是微信回调的账号信息。