mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
修复无法退出的bug
This commit is contained in:
@@ -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){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user