yiming
2024-04-29 c476915fdcb57387459ce6da1b43a502f4168628
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -187,6 +187,7 @@
        if (item.selectType == "document" || item.selectType == "pdf") {
          // freeFile
          console.log(item);
          const fileLink = item.file ?
            app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.freeFile
          console.log(fileLink, "fileLink");
@@ -195,6 +196,7 @@
          // 单次下载允许的最大文件为 200MB
          wx.downloadFile({
            url: fileLink,
            filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`,
            success: function (res) {
              console.log(res, "wx.downloadFile success res");
              if (res.statusCode != 200) {
@@ -202,8 +204,9 @@
                return false;
              }
              var Path = res.tempFilePath; //返回的文件临时地址,用于后面打开本地预览所用
              let data = res.filePath;
              wx.openDocument({
                filePath: Path,
                filePath: data,
                showMenu: true,
                success: function (res) {
                  console.log("打开成功");