尝试新增api 优化导出

This commit is contained in:
xuncha
2026-02-05 17:46:51 +08:00
committed by xuncha
parent 2d573896f9
commit ff2f6799c8
9 changed files with 943 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ import { contactExportService } from './services/contactExportService'
import { windowsHelloService } from './services/windowsHelloService'
import { llamaService } from './services/llamaService'
import { registerNotificationHandlers, showNotification } from './windows/notificationWindow'
import { httpService } from './services/httpService'
// 配置自动更新
@@ -1282,6 +1283,23 @@ function registerIpcHandlers() {
})
})
// HTTP API 服务
ipcMain.handle('http:start', async (_, port?: number) => {
return httpService.start(port || 5031)
})
ipcMain.handle('http:stop', async () => {
await httpService.stop()
return { success: true }
})
ipcMain.handle('http:status', async () => {
return {
running: httpService.isRunning(),
port: httpService.getPort()
}
})
}
// 主窗口引用