wx.openDocument PC端可以用Office或者wps打开Excel吗
自带的查看器显示异常,表头全部显示成一样的数字,还没有另存为的按钮 [图片] wx.downloadFile({
url: host + '/group/group/exportGroupDetail?groupId=' + _this.data.id,
// url: 'http://127.0.0.1:5500/1653895017317.xlsx',
// url: 'http://127.0.0.1:5500/%E7%96%AB%E6%83%85%E6%9C%9F%E9%97%B4%E8%A1%8C%E7%A8%8B%E7%99%BB%E8%AE%B0%E8%A1%A81.xlsx',
header: {
'Authorization': getToken(),
'Content-Type': 'application/vnd.ms-excel; charset=utf-8'
},
success(res) {
if (res.statusCode === 200) {
wx.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success: function () {
console.log('打开文档成功')
},
fail: function () {
console.log('打开失败');
}
})
} else {
reject()
}
wx.hideLoading()
},
fail() {
wx.hideLoading()
reject()
}
})
})