如何解决wx.cloud.downloadFile “empty download url”的问题?
onPreviewDocumnet: function (e) {
const fileID = e.detail.value;
console.log(encodeURI(fileID))
const that = this;
wx.cloud.downloadFile({
fileID: fileID
}).then(res => {
console.log(res);
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
that.setData({
showDocumentList: false
})
}
})
}).catch(error => {
console.log(error);
})
调用 一下 wx.cloud.getTempFileURL api 之后就可以了,一定要每次下载都获取下载地址?那这个 wx.cloud.downloadFile 传入fileID有什么用呢?不解