From a654091a33271a31234625b70ed65a941e4e7cf7 Mon Sep 17 00:00:00 2001 From: wangchunxiang Date: Mon, 29 Dec 2025 19:10:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=9B=B4=E6=96=B0=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=BD=91=E7=BB=9C=E5=9C=B0=E5=9D=80=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dexe4j=E7=9B=AE=E5=BD=95=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20-=20=E5=B0=86BASE=5FNET=5FURL=E4=BB=8E=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=9C=B0=E5=9D=80http://127.0.0.1:9606=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=BA=E7=94=9F=E4=BA=A7=E5=9C=B0=E5=9D=80http://13?= =?UTF-8?q?9.155.27.186:9607=20-=20=E4=BF=AE=E5=A4=8DPlaywrightManager?= =?UTF-8?q?=E4=B8=ADexe4j=E7=9B=AE=E5=BD=95=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E4=BB=8E=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?EXE4J=5FEXEDIR=E6=94=B9=E4=B8=BA=E7=B3=BB=E7=BB=9F=E5=B1=9E?= =?UTF-8?q?=E6=80=A7exe4j.launchName=20-=20=E6=B7=BB=E5=8A=A0=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=88=AA=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=8E?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E8=B7=AF=E5=BE=84=E4=B8=AD=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E8=B7=AF=E5=BE=84=20-=20=E6=9B=B4=E6=96=B0pl?= =?UTF-8?q?aywright=E6=B5=8F=E8=A7=88=E5=99=A8=E8=B7=AF=E5=BE=84=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E9=80=BB=E8=BE=91=E4=BB=A5=E4=BD=BF=E7=94=A8=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E7=9B=AE=E5=BD=95=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fantaibao/config/GlobalConfig.java | 4 ++-- .../java/com/fantaibao/config/PlaywrightManager.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/fantaibao/config/GlobalConfig.java b/src/main/java/com/fantaibao/config/GlobalConfig.java index 5bfb26a..9fb1588 100644 --- a/src/main/java/com/fantaibao/config/GlobalConfig.java +++ b/src/main/java/com/fantaibao/config/GlobalConfig.java @@ -7,8 +7,8 @@ public class GlobalConfig { /** * 基础网络地址 */ - public static final String BASE_NET_URL = "http://127.0.0.1:9606"; - //public static final String BASE_NET_URL = "http://139.155.27.186:9607"; + //public static final String BASE_NET_URL = "http://127.0.0.1:9606"; + public static final String BASE_NET_URL = "http://139.155.27.186:9607"; /** * 登录接口地址 diff --git a/src/main/java/com/fantaibao/config/PlaywrightManager.java b/src/main/java/com/fantaibao/config/PlaywrightManager.java index a969619..ee923c9 100644 --- a/src/main/java/com/fantaibao/config/PlaywrightManager.java +++ b/src/main/java/com/fantaibao/config/PlaywrightManager.java @@ -22,12 +22,16 @@ public class PlaywrightManager { throw new RuntimeException("请使用getInstance()方法获取实例"); } try { - String exe4jDir = System.getenv("EXE4J_EXEDIR"); - log.info("exe4j目录为:{}",exe4jDir); + String property = System.getProperty("exe4j.launchName"); + // 从完整路径中提取目录路径 + if (StrUtil.isNotBlank(property)) { + property = property.substring(0, property.lastIndexOf('\\')); + } + log.info("exe4j目录为:{}",property); String playwrightBrowsersPath; - if (StrUtil.isNotBlank(exe4jDir)) { + if (StrUtil.isNotBlank(property)) { log.info("当前运行环境为exe4j环境,将使用exe4j目录下的ms-playwright目录"); - playwrightBrowsersPath = exe4jDir + "\\ms-playwright"; + playwrightBrowsersPath = property + "\\ms-playwright"; } else { playwrightBrowsersPath = System.getenv("PLAYWRIGHT_BROWSERS_PATH"); }