wx.downloadFile{
filePath: wx.env.USER_DATA_PATH + '/' + 'temp.pdf',
url: url,
header:{
Authorization:wx.getStorageSync('token')
},
success:(res)=>{
if(res.statusCode == 200) {
wx.openDocument({
filePath: res.tempFilePath,
showMenu:true,
fileType:'pdf',
success(data) {
},
fail: console.error,
})
}
},
fail:(error)=>{
console.log(error);
setTimeout(()=>{
wx.showToast({
icon:'error',
title: '错误'
})
},300)
},
complete:()=>{
}
})
},
打印res.tempFilePath