云函数上怎么获取临时CDN链接的文件流?
发布于 3 年前 作者 qiangchen 9424 次浏览 来自 官方Issues

在小程序端用 wx.cloud.CDN 来传文件到云函数上了。

wx.cloud.callFunction({
  name: 'test',
  data: {
    img: wx.cloud.CDN({
      type: 'filePath',
      filePath: tempFilePath
    })
  }
}).then(res => { console.log(res) })
.catch(err => { console.error(res) })

云函数上也获取了临时 CDN 链接,不过没法获取此文件流。用 axios 报错 400 错误。

let a = await axios({
  url: event.img
})

console.log(a)

这个该怎么解决?

回到顶部