苹果端 wx.openDocument 无法打开文件?电脑模拟器和安卓手机可以?
wx.openDocument 和wx.downloadFile
wx.downloadFile({
url: app.globalData.ah_url + "url",
method:'GET',
success: function(res) {
console.log(res);
const tempFilePath = res.tempFilePath;
console.log(tempFilePath);
wx.openDocument({
filePath: tempFilePath,
fileType: 'xlsx',
success: function (res) {
console.log('打开文档成功')
},
fail: function(res) {
console.log("打开文档失败")
}
});
},
fail: function(res) {
console.log(res);
console.log('文件下载失败');
},
complete: function(res) {},
}) complete: function(res) {},
})