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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bf6a-2c2eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bf6a-2c2eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?