mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
v3.8.2 版本前端代码
This commit is contained in:
@ -1,5 +1,20 @@
|
||||
import {contextBridge, ipcRenderer} from 'electron'
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
import { ElectronEnum } from '../../src/enums/jeecgEnum';
|
||||
|
||||
contextBridge.exposeInMainWorld('_ELECTRON_PRELOAD_UTILS_', {
|
||||
contextBridge.exposeInMainWorld(ElectronEnum.ELECTRON_API, {
|
||||
openInBrowser: (url: string) => ipcRenderer.send('open-in-browser', url),
|
||||
// 发送消息通知
|
||||
sendNotification: (title: string, body: string, path: string) => {
|
||||
ipcRenderer.send('notify-with-path', { title, body, path });
|
||||
},
|
||||
// 绑定路由跳转
|
||||
onNavigate: (cb: (path: string) => void) => {
|
||||
ipcRenderer.on('navigate-to', (_, path) => cb(path));
|
||||
},
|
||||
// 任务栏闪
|
||||
sendNotifyFlash: () => ipcRenderer.send('notify-flash'),
|
||||
// 托盘闪动
|
||||
trayFlash: () => ipcRenderer.send('tray-flash'),
|
||||
// 托盘停止闪动
|
||||
trayFlashStop: () => ipcRenderer.send('tray-flash-stop'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user