request:fail url not in domain list?

小程序 文章 2021-01-27 12:01 0 14 全屏看文

request:fail url not in domain list?request:fail url not in domain list?

request:fail url not in domain list?


 getAccess_token(){

   var that=this;

  wx.request({

    url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=xxxx&secret=xxx',

    method: 'GET',

    success(res) {

      console.log("access_token",res.data.access_token)

      var access_token = res.data.access_token;  

      that.yesorno(access_token,that.data.SessionTotal);

    },

    fail(res) {

      console.log("res",res)

      console.log("access_token获取失败")

      that.addforum();

    }

  })

 },


getAccess_token(){ var that=this; wx.request({ url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=xxxx&secret=xxx', method: 'GET', success(res) { console.log("access_token",res.data.access_token) var access_token = res.data.access_token; that.yesorno(access_token,that.data.SessionTotal); }, fail(res) { console.log("res",res) console.log("access_token获取失败") that.addforum(); } }) },

回答:

z_oct.2:

不是不可以,是不应该这样做。

brave:

你这么nb?服务端API你搞小程序上用?

Mr.Zhao:

Mred×:

体验版本是可以正常获取到的

-EOF-