feat(config): 更新基础网络地址并修复exe4j目录获取逻辑

- 将BASE_NET_URL从本地地址http://127.0.0.1:9606更新为生产地址http://139.155.27.186:9607
- 修复PlaywrightManager中exe4j目录获取方式,从环境变量EXE4J_EXEDIR改为系统属性exe4j.launchName
- 添加路径截取逻辑,从完整路径中提取目录路径
- 更新playwright浏览器路径构建逻辑以使用新的目录获取方式
This commit is contained in:
2025-12-29 19:10:47 +08:00
parent f453adcd93
commit a654091a33
2 changed files with 10 additions and 6 deletions

View File

@@ -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://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://139.155.27.186:9607";
/** /**
* 登录接口地址 * 登录接口地址

View File

@@ -22,12 +22,16 @@ public class PlaywrightManager {
throw new RuntimeException("请使用getInstance()方法获取实例"); throw new RuntimeException("请使用getInstance()方法获取实例");
} }
try { try {
String exe4jDir = System.getenv("EXE4J_EXEDIR"); String property = System.getProperty("exe4j.launchName");
log.info("exe4j目录为:{}",exe4jDir); // 从完整路径中提取目录路径
if (StrUtil.isNotBlank(property)) {
property = property.substring(0, property.lastIndexOf('\\'));
}
log.info("exe4j目录为:{}",property);
String playwrightBrowsersPath; String playwrightBrowsersPath;
if (StrUtil.isNotBlank(exe4jDir)) { if (StrUtil.isNotBlank(property)) {
log.info("当前运行环境为exe4j环境将使用exe4j目录下的ms-playwright目录"); log.info("当前运行环境为exe4j环境将使用exe4j目录下的ms-playwright目录");
playwrightBrowsersPath = exe4jDir + "\\ms-playwright"; playwrightBrowsersPath = property + "\\ms-playwright";
} else { } else {
playwrightBrowsersPath = System.getenv("PLAYWRIGHT_BROWSERS_PATH"); playwrightBrowsersPath = System.getenv("PLAYWRIGHT_BROWSERS_PATH");
} }