request:fail url not in domain list就获取openid时候错 ?
let _this = this
uni.login({
provider: 'weixin',
success: function(res) {
let appid = _this.appid
let secret = _this.secret
let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' +
res.code + '&grant_type=authorization_code';
console.info(url);
uni.request({
url: url, // 请求路径
success: result => {
console.info(result.data.openid);
_this.userinfo.openid = result.data.openid;
//_this.gologin();
},
fail(err) {
console.info(err);
}
});
},
fail(err) {
console.info(err);
}
});