From e4d3e2b8b0927b7ada67c73d63e88f2940349eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E4=BA=AE?= Date: Wed, 17 Sep 2025 17:36:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E8=AE=BF?= =?UTF-8?q?=E9=97=AEip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/bmw/config/IpAndPathConfig.java | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/modules/bmw/src/main/java/com/bonus/bmw/config/IpAndPathConfig.java b/modules/bmw/src/main/java/com/bonus/bmw/config/IpAndPathConfig.java index 53572a5..300952d 100644 --- a/modules/bmw/src/main/java/com/bonus/bmw/config/IpAndPathConfig.java +++ b/modules/bmw/src/main/java/com/bonus/bmw/config/IpAndPathConfig.java @@ -14,14 +14,28 @@ public class IpAndPathConfig { */ // @Value("${environment}") // public static String environment; - public static String environment = "prod"; + public static String environment = "test"; + + public static String LINUX_URL = "/data/real_name/"; + + public static String WINDOWS_URL = "D:/yn/real_name/"; + + + public static String getUrl(){ + String os = System.getProperty("os.name"); + if(os.toLowerCase().startsWith("win")){ + return LINUX_URL; + }else{ + return WINDOWS_URL; + } + } /** * 持证 */ public static String certificateDevUrl = "http://127.0.0.1:21880/wcd/getWorkerCard"; - public static String certificateTestUrl = "http://192.168.0.14:21880/wcd/getWorkerCard"; + public static String certificateTestUrl = "http://192.168.0.7:21880/wcd/getWorkerCard"; public static String certificateProdUrl = "http://112.29.103.165:21880/wcd/getWorkerCard"; @@ -30,7 +44,7 @@ public class IpAndPathConfig { * 人脸检测后端相关 */ public static String faceDevUrl = "http://127.0.0.1:1909/file/"; - public static String faceTestUrl = "http://192.168.0.14:1909/file/"; + public static String faceTestUrl = "http://192.168.0.7:1909/file/"; public static String faceProdUrl = "http://112.29.103.165:1617/file/"; @@ -38,38 +52,20 @@ public class IpAndPathConfig { * 统一工作平台url地址 */ public static String unifiedPlatDevUrl = "http://127.0.0.1:27018/ynuw"; - public static String unifiedPlatTestUrl = "http://192.168.0.14:27018/ynuw"; + public static String unifiedPlatTestUrl = "http://192.168.0.7:27018/ynuw"; public static String unifiedPlatProdUrl = "http://112.29.103.165:1617/ynuw"; /** * 相关配置 */ public static String getFaceUrl(){ - if(environment.contains("prod")){ - return faceProdUrl; - }else if(environment.contains("test")){ - return faceTestUrl; - }else{ - return faceDevUrl; - } + return getUrl(); } public static String getUnifiedPlatUrl(){ - if(environment.contains("prod")){ - return unifiedPlatProdUrl; - }else if(environment.contains("test")){ - return unifiedPlatTestUrl; - }else{ - return unifiedPlatDevUrl; - } + return getUrl(); } public static String getCertificateUrl(){ - if(environment.contains("prod")){ - return certificateProdUrl; - }else if(environment.contains("test")){ - return certificateTestUrl; - }else{ - return certificateDevUrl; - } + return getUrl(); } }