wx.openDocument打不开文件怎么办?
发布于 5 年前 作者 fang38 8596 次浏览 来自 官方Issues
exportRemXsl(e){
    let header = {
      cookie:this.common.data.cookie,
      // 'content-type': "application/download"
    }
    wx.downloadFile({
      url: app.globalData.serverUrl + 'common/exportRemXls?remId=' + e.target.dataset.id,
      header:header,
      success: function (res) {
        let filePath = res.tempFilePath;
        console.log(res)
        wx.openDocument({
          fileType:'xls',
          filePath: filePath,
          success: function (res) {
            console.log('打开文档成功')
          },
          fail: function () {
            console.log('失败', res)
          }
        })
      }
    })
  },

后端java用HSSFWorkbook 生成的,安卓手机魅族16x ,微信是最新版本

3 回复

我也是部分手机打不开文件,开发者工具是可以的…楼主解决了吗

打不开的具体报错信息是什么呢?可以根据错误信息定位一下问题

开发者工具可以,手机不行

回到顶部