From 83a25a225357a6eeea1882f4eb79a22d84595c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Mon, 11 Mar 2024 14:35:44 +0800 Subject: [PATCH] 1 --- dist-electron/main.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/dist-electron/main.js b/dist-electron/main.js index 4bb7d2b..e69de29 100644 --- a/dist-electron/main.js +++ b/dist-electron/main.js @@ -1,40 +0,0 @@ -"use strict"; -const path = require("path"); -const electron = require("electron"); -let win; -electron.app.whenReady().then(() => { - win = new electron.BrowserWindow({ - title: "银收客", - width: 1024, - height: 768, - fullscreenable: true, - fullscreen: process.env.VITE_DEV_SERVER_URL ? false : true, - simpleFullscreen: true, - frame: process.env.VITE_DEV_SERVER_URL ? true : false, - webPreferences: { - // 集成网页和 Node.js,也就是在渲染进程中,可以调用 Node.js 方法 - nodeIntegration: true, - contextIsolation: false - } - }); - if (process.env.VITE_DEV_SERVER_URL) { - win.loadURL(process.env.VITE_DEV_SERVER_URL); - win.webContents.openDevTools(); - } else { - win.loadFile(path.resolve(__dirname, "../dist/index.html")); - } - electron.app.on("activate", () => { - if (electron.BrowserWindow.getAllWindows().length === 0) { - createWindow(); - } - }); - electron.ipcMain.on("quitHandler", (_, msg) => { - electron.app.quit(); - }); - electron.ipcMain.on("printStart", (event, arg) => { - }); -}); -electron.app.on("window-all-closed", () => { - if (process.platform !== "darwin") - electron.app.quit(); -});