C端改造

This commit is contained in:
2025-12-10 18:47:17 +08:00
parent 5708afb816
commit 4c477ae22a
61 changed files with 259 additions and 135 deletions

View File

@@ -166,11 +166,20 @@ class JavaRunner {
'-Dfile.encoding=UTF-8', // 设置文件编码为UTF-8解决中文乱码
'-Duser.language=zh', // 设置语言为中文
'-Duser.region=CN', // 设置地区为中国
'-jar',
jarPath,
`--spring.config.location=${configPath}`
];
// 如果提供了 logPath通过 JVM 系统属性传递给 logback
if (options.logPath) {
// Windows 路径使用正斜杠或保持原样JVM 会自动处理
// 方案1转换为正斜杠跨平台兼容
const normalizedLogPath = options.logPath.replace(/\\/g, '/');
javaArgs.push(`-DlogHomeDir=${normalizedLogPath}`);
console.log('[Java] Setting log path to:', normalizedLogPath);
console.log('[Java] Original log path:', options.logPath);
}
javaArgs.push('-jar', jarPath, `--spring.config.location=${configPath}`);
const defaultOptions = {
cwd: path.dirname(jarPath),
stdio: ['ignore', 'pipe', 'pipe'],