Mini Program can view all the information in the development tool, but the content of the network request (wx.request) cannot be seen in the mobile phone scan, as shown in the following figure

< H2 > question < / H2 >

static content can be displayed, but content obtained by ajax cannot be displayed

< H2 > app.js < / H2 >

commented to get user information

    // 
    // wx.getSetting({
    //   success: res => {
    //     if (res.authSetting["scope.userInfo"]) {
    //       //  getUserInfo 
    //       wx.getUserInfo({
    //         success: res => {
    //           //  res  unionId
    //           this.globalData.userInfo = res.userInfo

    //           //  getUserInfo  Page.onLoad 
    //           //  callback 
    //           if (this.userInfoReadyCallback) {
    //             this.userInfoReadyCallback(res)
    //           }
    //         }
    //       })
    //     }
    //   }
    // })
< H2 > the requested url is configured < / H2 >
  getData: function () {
    var that = this;
    wx.request({
      url: "https://cnodejs.org/api/v1/topics?page=" + this.data.page + "&tab=" + this.data.tab,
      method: "get",
      header: {
        "Content-Type": "json"
      },
      success: function (res) {
        that.setData({
          topsData: res.data.data
        })
      }
    })
  },

clipboard.png

clipboard.png
clipboard.png

clipboard.png


this
Arrow function

Menu