https://blog.csdn.net/qq_33744228/article/details/80240910(鏈接)
wx.downloadFile({
url: 'https://*****.***.work/videos/test2.pdf',
success: function (res) {
console.log(res)
var Path = res.tempFilePath //返回的文件臨時地址,用於后面打開本地預覽所用
wx.openDocument({
filePath: Path,
success: function (res) {
console.log('打開文檔成功')
}
})
},
fail:function (res){
console.log(res)
}
})