|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.hz.pm.api.external; |
|
|
|
|
|
|
|
import cn.hutool.http.useragent.UserAgentUtil; |
|
|
|
import com.hz.pm.api.meeting.entity.config.WebProps; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.file.entity.File; |
|
|
@@ -43,7 +44,9 @@ public class FilePreviewClient { |
|
|
|
|
|
|
|
public String getFilePreviewUrl(Long fileId, HttpServletRequest request) { |
|
|
|
String serverName = request.getServerName(); |
|
|
|
if (serverName.contains("weixin")) { |
|
|
|
log.info("serverName:{}", serverName); |
|
|
|
if (serverName.contains("weixin") || serverName.contains("10.54.38.13")) { |
|
|
|
// 浙政钉访问需要转换为互联网可访问的地址 |
|
|
|
String fileDownUrl = WebProps.zzdApiUrl + FILE_DOWN_NO_AUTH_URL + fileId; |
|
|
|
File file = fileService.getById(fileId); |
|
|
|
return String.format(PREVIEW_PATH_FMT, mhFilePreviewPublicUrl, fileDownUrl, file.getSuffix()); |
|
|
|