refactor: 统一端口配置,通过 IPC 获取而非硬编码
This commit is contained in:
@@ -366,6 +366,10 @@ ipcMain.handle('xc-opencode-web-get-status', () => {
|
||||
return xcOpenCodeWebService.getStatus();
|
||||
});
|
||||
|
||||
ipcMain.handle('xc-opencode-web-get-port', () => {
|
||||
return { port: xcOpenCodeWebService.port };
|
||||
});
|
||||
|
||||
ipcMain.handle('xc-opencode-web-start', async () => {
|
||||
return await xcOpenCodeWebService.start();
|
||||
});
|
||||
|
||||
@@ -44,4 +44,5 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
xcOpenCodeWebStart: () => ipcRenderer.invoke('xc-opencode-web-start'),
|
||||
xcOpenCodeWebStop: () => ipcRenderer.invoke('xc-opencode-web-stop'),
|
||||
xcOpenCodeWebGetStatus: () => ipcRenderer.invoke('xc-opencode-web-get-status'),
|
||||
xcOpenCodeWebGetPort: () => ipcRenderer.invoke('xc-opencode-web-get-port'),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user