方式一:使用uni.login来进行微信登录
代码:
uni.login({
provider:’weixin‘,
success:function(loginRes) {
uni.showToast({
title: '微信登录成功结果:'
});
console.log('---微信登录成功---');
console.log(loginRes);
}
})
问题:获取loginRes.refresh_token由后端服务器向微信平台请求刷新access_token有效期时得到无效refresh_token响应,微信响应内容:"{"errcode":40030,"errmsg":"invalid refresh_token, hints: [ req_id: 4hnCqRLnRa-Zea.NA ]"}",导致后端无法获取微信用户信息,同时在前端直接存放微信AppSecret存在安全隐患
方式二:使用plus.oauth.authorize来获取code
代码:
this.aweixin.authorize(function(e){
console.log('---授权成功---');
console.log(e);
plus.nativeUI.alert("授权成功:"+JSON.stringify(e));
}, function(e){
console.log('---授权失败---');
console.log(e);
plus.nativeUI.alert("授权失败:"+JSON.stringify(e));
}, {scope:'snsapi_userinfo',state:'test',appid:'xxxxxxx'});
问题:使用该方式微信直接弹出提示信息“由于应用BundleID信息校验不通过,无法使用微信登录”
请问还有没有方法了??
爱吃鱼的靖哥哥
你问题解决了没
2019-12-04 11:02