From 2998e524273cf7ba883eaf7175adbe16aa122334 Mon Sep 17 00:00:00 2001 From: qier222 Date: Tue, 24 Nov 2020 15:29:37 +0800 Subject: [PATCH] fix(electron): login issue --- src/background.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/background.js b/src/background.js index 1f7293a..2cfa7c5 100644 --- a/src/background.js +++ b/src/background.js @@ -9,6 +9,7 @@ import { createTouchBar } from "./electron/touchBar"; import { createDockMenu } from "./electron/dockMenu"; import { createTray } from "./electron/tray.js"; import { autoUpdater } from "electron-updater"; +import express from "express"; const isDevelopment = process.env.NODE_ENV !== "production"; @@ -49,8 +50,11 @@ function createWindow() { if (!process.env.IS_TEST) win.webContents.openDevTools(); } else { createProtocol("app"); - // Load the index.html when not in development - win.loadURL("app://./index.html"); + // win.loadURL("app://./index.html"); + const expressApp = express(); + expressApp.use("/", express.static(__dirname + "/")); + expressApp.listen(27232); + win.loadURL("http://localhost:27232"); } win.webContents.on("new-window", function (e, url) {