wx.openDocument真机调试可以打开文件,线上或者不开调试无法打开
- 当前 Bug 的表现(可附上截图)
用真机调试或者打开预览调试,是可以打开doc文件,但是开发者工具,或者不开调试模式 无法打开文件,报错如下截图
-
预期表现
-
复现路径
-
提供一个最简复现 Demo
//这是代码
openFile: function(e){
console.log(e.currentTarget.dataset.filename,“eee”)
wx.showLoading({
title: ‘文件加载中…’,
})
wx.downloadFile({
url: e.currentTarget.dataset.filename,
success: function (res) {
var filePath = res.tempFilePath
wx.openDocument({
filePath,
success: function (res) {
console.log(‘打开文档成功’)
} ,
fail(err){
console.log(“err”,err)
}
})
}
})
},//这是报错

