Commit 75c3308a authored by rocosen's avatar rocosen

Update main.ts

parent 19c5dbe7
...@@ -26,6 +26,10 @@ class AppUpdater { ...@@ -26,6 +26,10 @@ class AppUpdater {
let mainWindow: BrowserWindow | null = null; let mainWindow: BrowserWindow | null = null;
let win: BrowserWindow | null = null; let win: BrowserWindow | null = null;
const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:1212`
: `file://${__dirname}/index.html`
ipcMain.on('resize-site', (event) => { ipcMain.on('resize-site', (event) => {
if (win) { if (win) {
win.loadFile('index.html/site'); win.loadFile('index.html/site');
...@@ -49,11 +53,11 @@ ipcMain.on('createNewWindow', () => { ...@@ -49,11 +53,11 @@ ipcMain.on('createNewWindow', () => {
// parent: win, //win是主窗口 // parent: win, //win是主窗口
}); });
// win.loadURL(path.join('file:', __dirname, 'new.html')); //new.html是新开窗口的渲染进程 // win.loadURL(path.join('file:', __dirname, 'new.html')); //new.html是新开窗口的渲染进程
// win.loadURL('http://localhost:1212/#/site'); win.loadURL(winURL+"#/site");
// win.loadFile(path.join(__dirname)); // win.loadFile(path.join(__dirname));
win.loadFile('./index.html', { // win.loadFile('./index.html', {
hash: 'site', // hash: 'site',
}); // });
win.on('closed', () => { win.on('closed', () => {
win = null; win = null;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment