1549469775 4 years ago
parent
commit
e1f845d349
  1. 4
      src/main/index.ts
  2. 4
      src/main/menu.ts

4
src/main/index.ts

@ -45,8 +45,8 @@ function createWin() {
const URL = app.isPackaged const URL = app.isPackaged
? `file://${__dirname}/index.html` // vite 构建后的静态文件地址 ? `file://${__dirname}/index.html` // vite 构建后的静态文件地址
// : `http://localhost:${process.env.PORT}/#/` // vite 启动的服务器地址 : `http://localhost:${process.env.PORT}/#/` // vite 启动的服务器地址
: `http://localhost:8080/#/` // vite 启动的服务器地址 // : `http://localhost:8080/#/` // vite 启动的服务器地址
Shared.data.mainWindow?.loadURL(URL) Shared.data.mainWindow?.loadURL(URL)
} }

4
src/main/menu.ts

@ -24,14 +24,14 @@ let template = [
// //
webPreferences: { webPreferences: {
// 下面两个必须这么用,看a.md的文档 // 下面两个必须这么用,看a.md的文档
nodeIntegration: true, nodeIntegration: true,
contextIsolation: false, contextIsolation: false,
// 预加载动画 // 预加载动画
// preload: join(__dirname, "../../src/preload/index.js"), // 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.loadURL(process.env.NODE_ENV === "development" ? `http://localhost:${process.env.PORT}/#/about` : `file://${__dirname}/index.html#/about`);
newwin.on("ready-to-show", () => { newwin.on("ready-to-show", () => {
newwin?.show() newwin?.show()

Loading…
Cancel
Save