mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
17 lines
561 B
JavaScript
17 lines
561 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron');
|
|
const napcat = {
|
|
getWebUiUrl: async () => {
|
|
return ipcRenderer.invoke('napcat_get_webtoken');
|
|
},
|
|
openExternalUrl: async (url) => {
|
|
ipcRenderer.send('open_external_url', url);
|
|
},
|
|
openInnerUrl: async (url) => {
|
|
ipcRenderer.send('napcat_open_inner_url', url);
|
|
},
|
|
getWebUiUrlReact: async () => {
|
|
return ipcRenderer.invoke('napcat_get_reactweb');
|
|
}
|
|
};
|
|
// 在window对象下导出只读对象
|
|
contextBridge.exposeInMainWorld('napcat', napcat); |