From 7f9e62027a50a42e5dcb79368bbc526651540144 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 12 Feb 2025 16:48:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E7=BD=91=E5=90=8E=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=8D=87=E7=BA=A7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 ++++ preload.js | 4 ++++ src/App.tsx | 6 ++++++ src/render.d.ts | 1 + 4 files changed, 15 insertions(+) diff --git a/main.js b/main.js index d5a19ab..86d7857 100644 --- a/main.js +++ b/main.js @@ -160,6 +160,10 @@ app.on('ready', () => { startNumber++ } }); + // 更新 + ipcMain.handle('updateHandle', () => { + updateHandle() + }); // socket ipcMain.handle('startSignalr', (event, user) => { startSignalr(user) diff --git a/preload.js b/preload.js index 4879689..22bc873 100644 --- a/preload.js +++ b/preload.js @@ -91,6 +91,10 @@ window.electron = { setEnv: (str) => { ipcRenderer.invoke('setEnv', str) }, + // 更新 + updateHandle: () => { + ipcRenderer.invoke('updateHandle') + }, // 通知下载最新的包 onDownload: (type) => { ipcRenderer.invoke('updateDownload', type) diff --git a/src/App.tsx b/src/App.tsx index 7e28ca6..3e264ca 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -260,6 +260,12 @@ const App: React.FC = () => { storage.removeItem('user') navigate('/login') } + } else if (e.key === 'reconnect') { + if (e.value == true) { + if (location.hash.indexOf('/meeting') === -1) { + window.electron.updateHandle() + } + } } }; return ( diff --git a/src/render.d.ts b/src/render.d.ts index ad0eae5..0aeefea 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -25,6 +25,7 @@ export interface IElectronAPI { quitAndInstall: (callBack: Function) => void; isOpenWindows: (callBack: Function) => void; setEnv: (str: string) => any; + updateHandle: () => any; getVersion: () => Promise; isVisible: () => Promise; setRegistry: (uuid: string) => any;