refactor: 注释掉杀死后端的函数,改为由后端自杀

This commit is contained in:
2025-09-23 23:39:17 +08:00
parent 6fd46087bb
commit 2331d7e38b
3 changed files with 58 additions and 49 deletions

View File

@@ -125,9 +125,19 @@ const toggleMaximize = async () => {
const closeWindow = async () => {
try {
// 先调用后端关闭API
await Service.closeApiCoreClosePost()
console.log('Backend close API called successfully')
// 然后关闭窗口
await window.electronAPI?.windowClose()
} catch (error) {
console.error('Failed to close window:', error)
// 即使API调用失败也尝试关闭窗口
try {
await window.electronAPI?.windowClose()
} catch (closeError) {
console.error('Failed to close window after API error:', closeError)
}
}
}