修复无法退出的bug

This commit is contained in:
yuruo
2024-07-14 10:41:52 +08:00
parent 914bbbf7ae
commit 53cde241f3
2 changed files with 7 additions and 12 deletions

View File

@@ -1,3 +1,9 @@
export async function shutdownServer(){
await fetch('http://127.0.0.1:5000/shutdown')
try{
await fetch('http://127.0.0.1:5000/shutdown')
// 退出时会报异常
}catch(e){
}
}

View File

@@ -120,17 +120,6 @@ app.whenReady().then(() => {
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});}
const serverPath = process.platform === 'win32' ? '..\\..\\dist\\win-unpacked\\autoMateServer.exe' : './autoMateServer.exe';
exec(serverPath, (error: any, stdout: any, stderr: any) => {
if (error) {
console.error(`error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
}
)
// getWindowByName('code')
// getWindowByName('about')