feat: add auto-update functionality with settings UI
- Implement electron-updater integration with IPC handlers for update operations - Add Pinia store for managing update state and user preferences - Create settings UI with version display, update controls, and auto-update toggles - Update IPC constants and preload API for update-related communication - Refactor preload invoke methods to use async IPC consistently - Add rounded corners to settings page layout for better visual consistency
This commit is contained in:
@@ -23,17 +23,11 @@ const api: WindowApi = {
|
||||
// 通过 IPC 调用主进程
|
||||
readFile: (filePath: string) => ipcRenderer.invoke(IPC_EVENTS.READ_FILE, filePath),
|
||||
|
||||
// 同步调用
|
||||
invoke: (channel: IPC_EVENTS, ...args: any[]) => ipcRenderer.sendSync(IPC_EVENTS.INVOKE, channel, ...args),
|
||||
// 异步调用(映射为 electron 的 invoke)
|
||||
invoke: (channel: IPC_EVENTS, ...args: any[]) => ipcRenderer.invoke(channel, ...args),
|
||||
|
||||
// 异步调用
|
||||
invokeAsync: (channel: IPC_EVENTS, ...args: any[]) => {
|
||||
try {
|
||||
ipcRenderer.invoke(IPC_EVENTS.INVOKE_ASYNC, channel, ...args)
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
},
|
||||
// 异步调用(为了兼容老代码)
|
||||
invokeAsync: (channel: IPC_EVENTS, ...args: any[]) => ipcRenderer.invoke(channel, ...args),
|
||||
|
||||
// 监听主进程消息
|
||||
on: (event: IPC_EVENTS, callback: (...args: any[]) => void) => {
|
||||
|
||||
Reference in New Issue
Block a user