收藏
回答

关于fetch方法

function fetchURL(url, callback) {

  return fetch(url)

    .then(function (response) {

      console.log('5 '+response.status);

      if (response.status == 200) {

        return response.json();

      }

    }).then(function (data) {

      console.log(data);

      if (typeof callback == 'function') {

        callback(data);

      }

    });

}

为什么这个方法走到fetch()的时候就报错了?

回答关注问题邀请回答
收藏

1 个回答

  • Sincere 🎈
    Sincere 🎈
    2017-05-02

    请用wx.request

    2017-05-02
    有用
    回复
登录 后发表内容