吉安感知网项目-后端
linwei
2026-07-10 1365ef8b4db5f1a0b8411b687cfaadf1f32bc756
drone-ops/drone-resource/src/main/java/org/sxkj/resource/controller/AttachController.java
@@ -477,14 +477,15 @@
      // 10. 构建代理下载URL,替代直接使用远程URL
      // Document Server通过代理下载接口获取文件,避免无法直接访问远程URL的问题
      String documentUrl = buildProxyDownloadUrl(request, attachId);
      // if (onlyofficeBaseUrl != null && !onlyofficeBaseUrl.isEmpty()) {
      //    // 使用代理下载URL,Document Server通过本服务的代理接口获取文件
      //    documentUrl = onlyofficeBaseUrl + "/attach/onlyoffice-download?attachId=" + attachId;
      // } else {
      //    // 未配置baseUrl时回退到直接使用远程URL
      //    documentUrl = fileUrl != null ? fileUrl : "";
      // }
      String documentUrl;
      // String documentUrl = buildProxyDownloadUrl(request, attachId);
      if (onlyofficeBaseUrl != null && !onlyofficeBaseUrl.isEmpty()) {
         // 使用代理下载URL,Document Server通过本服务的代理接口获取文件
         documentUrl = onlyofficeBaseUrl + "/attach/onlyoffice-download?attachId=" + attachId;
      } else {
         // 未配置baseUrl时回退到直接使用远程URL
         documentUrl = fileUrl != null ? fileUrl : "";
      }
      // 11. 生成文档唯一标识
      String key = generateRevisionId(fileName);