wx.openDocument手机端正常,为什么windows端无法打开?
发布于 5 年前 作者 qtao 11085 次浏览 最后一次编辑是 4 年前 来自 问答
wx.downloadFile({
      url'https://---------'+relative_path+'/'+doc_name,
      successfunction (res{
        const tempFilePath = res.tempFilePath;
        // 保存文件
        wx.saveFile({
          tempFilePath,
          successfunction (res{
            const savedFilePath = res.savedFilePath;
            console.log("savedFilePath is:");
            console.log(savedFilePath);
            // 打开文件
            wx.openDocument({
              filePath: savedFilePath,
              successfunction (res{
                console.log('打开文档成功')
              },
            });
          },

如图,提示打开成功,通过任务管理器查看起了一个进程叫wxfilewatcher.exe,但是没有调用到word或其他控件来打开文档。

1 回复

你好,加下这个试试?

回到顶部