const { contextBridge, ipcRenderer } = require("electron"); // const path = require("path"); // 安全暴露数据库操作方法 contextBridge.exposeInMainWorld("electronAPI", { updateConfig: async (tableName, key, value) => { return await ipcRenderer.invoke("update-config", tableName, key, value); }, getConfig: async (tableName, key) => { return await ipcRenderer.invoke("get-config", tableName, key); }, bulkInsertSystemMessages: async messages => { return await ipcRenderer.invoke("bulk-insert-system-messages", messages); }, startProcess: (fileName, exeName) => ipcRenderer.invoke("start-process", fileName, exeName), stopProcess: (fileName, exeName) => ipcRenderer.invoke("stop-process", fileName, exeName), stopAllProcesses: () => ipcRenderer.invoke("stop-all-process") });