wx.downloadFile显示filePath为Undefined,可是打印出来是有的啊?
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:()=>{
}
})
},
[图片]