调用wx.openDocument来打开.xlsx的excel文件不生效?
这两天在小程序上开了个附件下载的功能,开发过程中调试、二维码预览、体验版附件下载都是成功的,上线之后用PC打开小程序下载附件却只会跳出一个“打开文档”,看控制台打印的返回结果也没有报错,这是什么情况?[图片]附上代码: wx.downloadFile({
url: url,
filePath: newPath,
success: function (res) {
const filePath = res.tempFilePath;
wx.openDocument({
filePath: newPath,
showMenu: true,
fileType: 'xlsx',
success: function (res) {
console.log(res)
}
})
},
fail: function (res) {
wx.showToast({
title: res,
icon: 'error',
duration: 2000
})
wx.hideLoading();
},
complete: function (res) {
wx.showToast({
title: res,
icon: 'error',
duration: 2000
})
}
})