C端改造
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user