From 2d1fe95be0a97e7a94be236cd6207b9d65e172d5 Mon Sep 17 00:00:00 2001 From: cirry <812852553@qq.com> Date: Fri, 10 Apr 2026 14:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.css | 8 ------- src/main.js | 56 ------------------------------------------------- src/preload.js | 2 -- src/renderer.js | 33 ----------------------------- 4 files changed, 99 deletions(-) delete mode 100644 index.css delete mode 100644 src/main.js delete mode 100644 src/preload.js delete mode 100644 src/renderer.js diff --git a/index.css b/index.css deleted file mode 100644 index 3a16b1c..0000000 --- a/index.css +++ /dev/null @@ -1,8 +0,0 @@ -body { - font-family: - -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, - sans-serif; - margin: auto; - max-width: 38rem; - padding: 2rem; -} diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 158d722..0000000 --- a/src/main.js +++ /dev/null @@ -1,56 +0,0 @@ -import { app, BrowserWindow } from 'electron'; -import path from 'node:path'; -import started from 'electron-squirrel-startup'; - -// Handle creating/removing shortcuts on Windows when installing/uninstalling. -if (started) { - app.quit(); -} - -const createWindow = () => { - // Create the browser window. - const mainWindow = new BrowserWindow({ - width: 800, - height: 600, - webPreferences: { - preload: path.join(__dirname, 'preload.js'), - }, - }); - - // and load the index.html of the app. - if (MAIN_WINDOW_VITE_DEV_SERVER_URL) { - mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL); - } else { - mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`)); - } - - // Open the DevTools. - mainWindow.webContents.openDevTools(); -}; - -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. -// Some APIs can only be used after this event occurs. -app.whenReady().then(() => { - createWindow(); - - // On OS X it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. - app.on('activate', () => { - if (BrowserWindow.getAllWindows().length === 0) { - createWindow(); - } - }); -}); - -// Quit when all windows are closed, except on macOS. There, it's common -// for applications and their menu bar to stay active until the user quits -// explicitly with Cmd + Q. -app.on('window-all-closed', () => { - if (process.platform !== 'darwin') { - app.quit(); - } -}); - -// In this file you can include the rest of your app's specific main process -// code. You can also put them in separate files and import them here. diff --git a/src/preload.js b/src/preload.js deleted file mode 100644 index 5e9d369..0000000 --- a/src/preload.js +++ /dev/null @@ -1,2 +0,0 @@ -// See the Electron documentation for details on how to use preload scripts: -// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts diff --git a/src/renderer.js b/src/renderer.js deleted file mode 100644 index 757e88f..0000000 --- a/src/renderer.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file will automatically be loaded by vite and run in the "renderer" context. - * To learn more about the differences between the "main" and the "renderer" context in - * Electron, visit: - * - * https://electronjs.org/docs/tutorial/process-model - * - * By default, Node.js integration in this file is disabled. When enabling Node.js integration - * in a renderer process, please be aware of potential security implications. You can read - * more about security risks here: - * - * https://electronjs.org/docs/tutorial/security - * - * To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration` - * flag: - * - * ``` - * // Create the browser window. - * mainWindow = new BrowserWindow({ - * width: 800, - * height: 600, - * webPreferences: { - * nodeIntegration: true - * } - * }); - * ``` - */ - -import './index.css'; - -console.log( - '👋 This message is being logged by "renderer.js", included via Vite', -);