获得小程序码getWXACodeUnlimit

报错47001 data format error

出现这个错误必须是Body里面的raw才可以,而且access_token参数必须写在地址后面,不能写在raw里面,不然也出错。

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this
    //通过分享进来的  接收参数(id)以及跳转的地址(page)
     if (options.scene) {
//options.scene必须要decodeURIComponent处理才能拿到
       let scene = decodeURIComponent(options.scene);
       //&是我们定义的参数链接方式
       let id= options.scene.split("&")[0];
       let page= options.scene.split('&')[1];
      
     }
}
原文地址:https://www.cnblogs.com/bin521/p/10168865.html