mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
✨ feat: 添加eslint 和 桌面歌词(未完成)
This commit is contained in:
+11
-8
@@ -1,4 +1,4 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
const { contextBridge, ipcRenderer, app } = require('electron');
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
minimize: () => ipcRenderer.send('minimize-window'),
|
||||
@@ -7,19 +7,22 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
dragStart: (data) => ipcRenderer.send('drag-start', data),
|
||||
miniTray: () => ipcRenderer.send('mini-tray'),
|
||||
restart: () => ipcRenderer.send('restart'),
|
||||
})
|
||||
openLyric: () => ipcRenderer.send('open-lyric'),
|
||||
sendLyric: (data) => ipcRenderer.send('send-lyric', data),
|
||||
});
|
||||
|
||||
const electronHandler = {
|
||||
ipcRenderer: {
|
||||
setStoreValue: (key, value) => {
|
||||
ipcRenderer.send("setStore", key, value)
|
||||
ipcRenderer.send('setStore', key, value);
|
||||
},
|
||||
|
||||
getStoreValue(key) {
|
||||
const resp = ipcRenderer.sendSync("getStore", key)
|
||||
return resp
|
||||
const resp = ipcRenderer.sendSync('getStore', key);
|
||||
return resp;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
app,
|
||||
};
|
||||
|
||||
contextBridge.exposeInMainWorld('electron', electronHandler)
|
||||
contextBridge.exposeInMainWorld('electron', electronHandler);
|
||||
|
||||
Reference in New Issue
Block a user