用过云开发,下载以后,我的函数的变量都会乱
发布于 6 年前 作者 tyao 892 次浏览 来自 问答

使用过wx.cloud.downloadFile 后,   wx.cloud.downloadFile({

            fileID: this.data.bgfileID,

            success: res => {

              // get temp file path

             // console.log(“dowload file OK111!!!>>>>”)

             // console.log(res.tempFilePath)

             // this.setData({

               // bgjpg: res.tempFilePath,  //切换分享的背景

             // })

            },

            fail: err => {

              // handle error

             // console.log(“dowload file fail!!!>>>>”)

            }

          })

用过这个函数以后,调用这个函数getImageInfo(AAA) //AAA是好的有值,

这个函数的url就是在外层是好的,再这

function getImageInfo(url) { //------------在这里加打印就是没有定义------------

  return new Promise((resolve, reject) => {

    wx.getImageInfo({

      src: url,

      success: resolve,

      fail: reject,

    })

  })

}

 ------------在这里就是没有定义------------非常奇怪的Bug

回到顶部