Commit 75c3308a authored by rocosen's avatar rocosen

Update main.ts

parent 19c5dbe7
......@@ -26,6 +26,10 @@ class AppUpdater {
let mainWindow: 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) => {
if (win) {
win.loadFile('index.html/site');
......@@ -49,11 +53,11 @@ ipcMain.on('createNewWindow', () => {
// parent: win, //win是主窗口
});
// 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('./index.html', {
hash: 'site',
});
// win.loadFile('./index.html', {
// hash: 'site',
// });
win.on('closed', () => {
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