html52.com
我爱小程序-开发者交流社区

为什么会先执行request,再执行wx.login?

if (Wechat.getStorageSync("openId")) {

params.openId = Wechat.getStorageSync("openId")

return this.wxRequest(isHideLoading, langUrl, params, method);

} else {

return  Wechat.login().then(res => {

Wechat.request('https://testweixin.shangbin.org/wx_account/getOpenId', {

code: res.code

}, 'post').then((res) => {

Wechat.setStorage("openId", res.data);

params.openId = res.data;

return this.wxRequest(isHideLoading, langUrl, params, method);

})

});

}


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付