"result" to undefined is invalid.
发布于 6 年前 作者 taomao 17713 次浏览 来自 问答

代码是这样的:

GetHttpData(gsxm, gsdh, callback) {


    wx.request({

     url: 'https://www.wjzjdy.cn/Default_cx.aspx?xname=' + gsxm + '&xpwd=' + gsdh,

      data: {

        x: '',

        y: ''

      },

      //json格式的的header头

      header: {

        'Content-Type': 'application/json'

      },

      success: function (res) {


        var qresult = res.data.result //获取json数组 

        callback(qresult)

      }

      , fail: function (res) {


      }

      , complete: function (res) {


      }

    })


在微信小程序出现问题,请教各位大师如何解决?

2 回复

报错不是说了嘛,res.data是个undefined

要解决的具体方法?

回到顶部