Przeglądaj źródła

更换api地址

lidongyang 5 lat temu
rodzic
commit
7e1c9c0065

+ 3 - 0
src/main/java/com/lightinit/hsdataportal/common/SysContants.java

@@ -87,6 +87,9 @@ public class SysContants {
         public final static String GATEWAYURL_AUTHSAVE = GETGATEWAYURL + "/authsave" ;
         // 添加计费
         public final static String GATEWAYURL_CHARGESAVE = GETGATEWAYURL + "/chargesave" ;
+        // 调用前缀路径
+        public static final String GATEWAYVIEWURL = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString("gatewayViewUrl") ;
+
 
     }
 

+ 16 - 0
src/main/java/com/lightinit/hsdataportal/impl/APIServiceImpl.java

@@ -123,6 +123,22 @@ public class APIServiceImpl implements IAPIservice {
         if (list.size() > 0) {
             List<APIOpenInterfaceViewModel> apiOpenInterfaceViewModelList = new ArrayList<>();
             for (ResourceApiInterfaceWithBLOBs resourceApiInterfaceWithBLOBs : list) {
+                // 替换地址
+                String url = resourceApiInterfaceWithBLOBs.getUrl();
+                if (org.apache.commons.lang.StringUtils.isNotEmpty(url)){
+                    String newUrl = null ;
+                    // 映射路径
+                    url.replace("https://", "");
+                    if (url.contains("http://")){
+                        newUrl =  url.replace("http://", "") ;
+                    }
+                    if (url.contains("https://")){
+                        newUrl =   url.replace("https://", "") ;
+                    }
+                    int i = newUrl.indexOf("/");
+                    String substring = SysContants.GatewayPath.GATEWAYVIEWURL+newUrl.substring(i, newUrl.length());
+                    resourceApiInterfaceWithBLOBs.setUrl(substring);
+                }
                 APIOpenInterfaceViewModel apiOpenInterfaceViewModel = new APIOpenInterfaceViewModel();
                 BeanUtils.copyProperties(resourceApiInterfaceWithBLOBs, apiOpenInterfaceViewModel);
 

+ 1 - 0
src/main/resources/config.properties

@@ -105,6 +105,7 @@ uploadImageRootDir=D:/HSDataPlatform/Upload/Images/
 
 # 对接服务网关前缀地址
 gatewayUrl=http://localhost:8080/gateway/interface
+gatewayViewUrl=http://citysdk.dgtis.com:8080/hsdatagateway/foreign/search
 
 
 

+ 4 - 4
src/main/webapp/pages/open/microapp/detail.jsp

@@ -481,11 +481,11 @@
         if (!checkAuthentication()){
             return;
         }
-        if(${list.size()>0}) {
-            $("iframe").attr("src", "<%=basePath%>/open/microapp/openDemo.action/${model.microappId}/1");
-        }else {
+        <%--if(${list.size()>0}) {--%>
+        <%--    $("iframe").attr("src", "<%=basePath%>/open/microapp/openDemo.action/${model.microappId}/1");--%>
+        <%--}else {--%>
             $("iframe").attr("src", "<%=basePath%>/open/microapp/openDemo.action/${model.microappId}/2");
-        }
+        // }
         <%--$("iframe").attr("src", "${model.demoUrl}");--%>
         $("#divDemo").show();
     }