我用的h5+plus app中写的授权登录,在plusReady中,获取不到授权信息,请问怎么才能获取到login之后success回调参数,appid,appsecret都写了。现在的需求是,有公众号appid,怎么才能静默获取到用户的openid
plus.oauth.getServices( function(services){
auths = services;
console.log(JSON.stringify(auths))
authLogin(auths);
}, function(e){
alert( "获取分享服务列表失败:"+e.message+" - "+e.code );
} );
function authLogin(auths){
var s = auths[0];
if ( !s.authResult ) {
s.login( function(e){
alert(JSON.stringify(s.authResult));
}, function(e){
alert(JSON.stringify(s.authResult));
}, {appid:"xxx" // 微信应用的appid
,scope:"snsapi_userinfo",
appsecret:'xxx'} // 授权获取用户信息
);
}
}
7***@qq.com
- 发布:2018-07-24 01:13
- 更新:2018-07-24 01:13
- 阅读:2191
0 个回复