From 5f418ec73189672a1a7bd1db686e68c28cdb29f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Mon, 8 Nov 2021 20:35:41 +0800 Subject: [PATCH] chore(deps): remove useless files --- src/common/constant/event.ts | 12 ----- src/common/constant/index.ts | 2 - src/main/communication.ts | 16 ------- src/main/index.ts | 9 +--- src/preload/loading.html | 93 ------------------------------------ 5 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 src/common/constant/event.ts delete mode 100644 src/common/constant/index.ts delete mode 100644 src/main/communication.ts delete mode 100644 src/preload/loading.html 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 @@ - - - - - -
- - -