From 6569dcc49c5c22e18f5f8cc389b08e4eda14b4ac Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 9 May 2023 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9F=A5=E7=9C=8B=E5=A4=96?= =?UTF-8?q?=E7=BD=91=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/admin/idc/controller/IdcController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/idc/controller/IdcController.java b/api-admin/src/main/java/com/glxp/sale/admin/idc/controller/IdcController.java index 6cf93fa..f80e0dc 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/idc/controller/IdcController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/idc/controller/IdcController.java @@ -10,6 +10,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.glxp.sale.admin.util.MyStrUtil; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -149,6 +150,7 @@ public class IdcController { if (StrUtil.isNotEmpty(upperServerHost)) { uri = upperServerHost + "/" + uri; } + uri = changeUri(uri); log.info(uri); if (uri.contains("getImage")) { return redirectIamge(request, httpServletResponse, uri); @@ -157,6 +159,18 @@ public class IdcController { } } + public String changeUri(String uri) { + String isTopService = systemParamConfigService.selectValueByParamKey("is_top_service"); + if (StrUtil.isNotEmpty(isTopService) && isTopService.equals("1")) { + if (uri.contains("SP_SYNC_SERVER")) { + uri = uri.replace("SP_SYNC_SERVER/", ""); + } + } else { + uri = MyStrUtil.deDup(uri); + } + log.error("changeUri = " + uri); + return uri; + } private byte[] redirectIamge(HttpServletRequest request, HttpServletResponse httpServletResponse, String uri) { RestTemplate restTemplate = new RestTemplate();