官方實例:
wx.downloadFile({
// 示例 url,並非真實存在
url: 'http://example.com/somefile.pdf',
success: function (res) {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打開文檔成功')
}
})
}
})
實際拷貝代碼到開發者工具,工具也打不開,真機也打不開
解決辦法:
配置fileType