小程序云开发,下载的临时路径,无法绘制在CANVAS上,求解~~~
- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
wx.cloud.downloadFile({
//fileID: ‘https://avatar.csdn.net/7/0/2/3_u012729832.jpg’,
fileID: ‘cloud://tiantianhaibao-5ada78.7469-tiantianhaibao-5ada78/images/banner/1550726617370.jpg’,
success: res => {
console.log(res.tempFilePath)
ctx.drawImage(res.tempFilePath, 0, 0, 100, 100)
},
fail: console.error
})
//这个临时路径是可以读取出来的,可是无论如何在canvas上也画不出来,求解~~
2 回复
wx.downloadFile不是wx.cloud.downloadFile
https://developers.weixin.qq.com/miniprogram/dev/api/wx.downloadFile.html?search-key=downloadFile