yubin 3 өдөр өмнө
parent
commit
a7a71d4324

+ 4 - 2
mall-service/src/main/java/com/txz/mall/configurer/OpenApiConfig.java

@@ -25,6 +25,8 @@ public class OpenApiConfig {
 
 //    @Value("${server.port}")
 //    private String mallPort;
+    @Value("${server.host}")
+    private String host;
     @Resource
     private DiscoveryClient discoveryClient;
     @Bean
@@ -75,12 +77,12 @@ public class OpenApiConfig {
 
         List<ServiceInstance> gateway = discoveryClient.getInstances("backstage");
 
-        String gatewayUrl = "http://192.168.0.112:8401/mall";
+        String gatewayUrl = "";
         if(!CollectionUtils.isEmpty(gateway)){
             ServiceInstance serviceInstance = gateway.get(0);
 
             String serviceId = serviceInstance.getServiceId();
-            String host = serviceInstance.getHost();
+          //  String host = serviceInstance.getHost();
             int port = serviceInstance.getPort();
             gatewayUrl = "http://"+host+":"+port+"/mall";
         }

+ 3 - 1
mall-service/src/main/resources/bootstrap.properties

@@ -111,4 +111,6 @@ xxl.job.accessToken=${${spring.profiles.active}.accessToken}
 xxl.job.executor.ip=
 xxl.job.executor.port=4444
 xxl.job.executor.logpath=/var/logs/xxljob/${spring.application.name}/jobhandler
-xxl.job.executor.logretentiondays=4
+xxl.job.executor.logretentiondays=4
+
+server.host=124.222.152.234