Page({
onLoad: function (options) {
wx.createSelectorQuery()
.select('#ccc')
.fields({
node: true,
size: true,
})
.exec(this.init.bind(this))
},
init(res) {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
const img = canvas.createImage()
img.onload = () => {
this._img = img
}
wx.cloud.downloadFile({
fileID: 'cloud://cloud-aaaaaaaaaa.xxxxxxxxxxxxxxxxxx.jpg'
}).then(res => {
const path = res.tempFilePath
console.log('rrrrr', res)
img.src = path //这里报错了
})
},
render(ctx) {
// ctx.drawImage(this._img,0,0)
}
})
报错信息为'500 (Internal Server Error)',无法访问这个图片资源. 但是 'res' 里面是有东西的.
你好,麻烦提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。