|
|
|
@ -348,12 +348,9 @@ function createWindow() {
@@ -348,12 +348,9 @@ function createWindow() {
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
try { |
|
|
|
|
const { spawn } = require('child_process'); |
|
|
|
|
// 在 Windows 环境下使用 npm.cmd
|
|
|
|
|
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'; |
|
|
|
|
const buildProcess = spawn(npmCommand, ['run', 'build:vue'], {
|
|
|
|
|
const buildProcess = spawn('npm', ['run', 'build:vue'], {
|
|
|
|
|
cwd: appRoot, |
|
|
|
|
stdio: 'pipe', |
|
|
|
|
shell: true |
|
|
|
|
stdio: 'pipe' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
buildProcess.on('close', (code) => { |
|
|
|
@ -721,3 +718,13 @@ process.on('unhandledRejection', (reason, promise) => {
@@ -721,3 +718,13 @@ process.on('unhandledRejection', (reason, promise) => {
|
|
|
|
|
console.error('Unhandled promise rejection:', reason) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 测试日志系统 - 在开发环境下生成一些测试错误
|
|
|
|
|
if (getIsDev()) { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
console.error('测试错误日志 1: 这是一个模拟的错误信息') |
|
|
|
|
}, 5000) |
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
console.error('测试错误日志 2: 另一个模拟的错误信息') |
|
|
|
|
}, 10000) |
|
|
|
|
} |
|
|
|
|