diff --git a/src/common/constant/event.ts b/src/common/constant/event.ts deleted file mode 100644 index fcf6304..0000000 --- a/src/common/constant/event.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 主进程、渲染进程公用事件常量 - */ - - /** 退出 */ -export const LOGOUT = '@event/logout' - -/** 登录 */ -export const LOGIN = '@event/login' - -/** 切换开发者工具 */ -export const TOGGLE_DEVTOOLS = 'toggle-devtools' diff --git a/src/common/constant/index.ts b/src/common/constant/index.ts deleted file mode 100644 index ffe56f2..0000000 --- a/src/common/constant/index.ts +++ /dev/null @@ -1,2 +0,0 @@ - -export * as event from './event' diff --git a/src/main/communication.ts b/src/main/communication.ts deleted file mode 100644 index 376cb25..0000000 --- a/src/main/communication.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Expose something function to renderer - */ -import { BrowserWindow, ipcMain } from 'electron' -import { - LOGIN, - LOGOUT, - TOGGLE_DEVTOOLS, -} from '@/common/constant/event' - -export function register(win: BrowserWindow) { - ipcMain.handle(TOGGLE_DEVTOOLS, () => { - win.webContents.toggleDevTools() - }) - ipcMain.handle(LOGOUT, () => { }) -} diff --git a/src/main/index.ts b/src/main/index.ts index 4167511..8c0bb42 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,10 +1,6 @@ import path from 'path' -import { app, BrowserWindow } from 'electron' -import { register } from './communication' +import { app, BrowserWindow, ipcMain } from 'electron' -/** - * Main Process some code reference https://github.com/cawa-93/vite-electron-builder - */ app.disableHardwareAcceleration() if (!app.requestSingleInstanceLock()) { @@ -28,9 +24,6 @@ function bootstrap() { win.webContents.openDevTools() win.loadURL(`http://localhost:${process.env.PORT}`) } - - // something init setup - register(win) } app.whenReady().then(bootstrap) diff --git a/src/preload/loading.html b/src/preload/loading.html deleted file mode 100644 index c8251f3..0000000 --- a/src/preload/loading.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - electron-vue3-vite - - - - -
-
-
- - - \ No newline at end of file