diff --git a/src/main/index.ts b/src/main/index.ts index 232646c..a8b5d88 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -45,8 +45,8 @@ function createWin() { const URL = app.isPackaged ? `file://${__dirname}/index.html` // vite 构建后的静态文件地址 - // : `http://localhost:${process.env.PORT}/#/` // vite 启动的服务器地址 - : `http://localhost:8080/#/` // vite 启动的服务器地址 + : `http://localhost:${process.env.PORT}/#/` // vite 启动的服务器地址 + // : `http://localhost:8080/#/` // vite 启动的服务器地址 Shared.data.mainWindow?.loadURL(URL) } diff --git a/src/main/menu.ts b/src/main/menu.ts index b143e17..3f003e6 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -24,14 +24,14 @@ let template = [ // webPreferences: { // 下面两个必须这么用,看a.md的文档 - nodeIntegration: true, + nodeIntegration: true, contextIsolation: false, // 预加载动画 // preload: join(__dirname, "../../src/preload/index.js"), }, }) // 隐藏菜单 - newwin?.setMenuBarVisibility(false) + newwin.setMenuBarVisibility(false) newwin.loadURL(process.env.NODE_ENV === "development" ? `http://localhost:${process.env.PORT}/#/about` : `file://${__dirname}/index.html#/about`); newwin.on("ready-to-show", () => { newwin?.show()