https://uniapp.dcloud.net.cn/tutorial/app-oauth-google.html#
var googleOauth = null;
plus.oauth.getServices(function(services) {
for (var i in services) {
var service = services[i];
// 获取微信登录对象
if (service.id == 'google') {
googleOauth = service;
break;
}
}
googleOauth.login( function(oauth){
// 授权成功,googleOauth.authResult 中保存授权信息
}, function(err) {
// 登录授权失败
// err.code是错误码
})
}, function(err) {
// 获取 services 失败
})
0 个回复