| | |
| | | |
| | | // 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); |