管理中心 -> 快应用智慧服务 -> 选择一个快应用 -> 找到移动服务
根据 OPPO 快应用帐号服务开启指南开通服务即可,其中回调地址可以随便写,可以使用 oppo 的示例即可
二、获取用户信息
开通账户服务之后我们就可以参考文档来获取用户信息了,但是这里还是拿不到用户信息的
- 调用授权接口
account.authorize返回的信息格式是这样的
{
"accessToken":"token",
"state":"state",
"tokenType":"type",
"scope":"scope",
"expiresIn":""
}
解决方法
加了官方群后无人解答,最后问了客服找到了答案
完整示例代码
onInit(){
account.authorize({
type: 'token',
redirectUri: 'https://baidu.com', // 跳转地址,可不填
scope: 'scope.baseProfile',
success: function (data) {
console.log(JSON.stringify(data))
// 获取用户基本信息
account.getProfile({
token: data.accessToken,
success: function (data) {
prompt.showToast({
message: 'handling success:' + JSON.stringify(data),
duration: 1
})
},
fail: function (data, code) {
prompt.showToast({
message: `getProfile handling fail, code = ${code}`,
duration: 1
})
}
})
},
fail: function (data, code) {
prompt.showToast({
message: `authorize handling fail, code = ${code}`,
duration: 1
})
}
})
},
以上所述就是小编给大家介绍的《oppo快应用开通账号服务获取openid记录》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Domain-Driven Design Distilled
Vaughn Vernon / Addison-Wesley Professional / 2016-6-2 / USD 36.99
Domain-Driven Design (DDD) software modeling delivers powerful results in practice, not just in theory, which is why developers worldwide are rapidly moving to adopt it. Now, for the first time, there......一起来看看 《Domain-Driven Design Distilled》 这本书的介绍吧!