Commit a4de65ea authored by rocosen's avatar rocosen

1

1
parent 412ea67c
......@@ -73,10 +73,10 @@ ipcMain.on('createNewWindow', () => {
});
// win.loadURL(path.join('file:', __dirname, 'new.html')); //new.html是新开窗口的渲染进程
// win.loadURL(winURL);
// win.loadURL(resolveHtmlPath('index.html/#/site'));
win.loadFile(resolveHtmlPath('/index.html'), {
hash: 'site',
});
win.loadURL(resolveHtmlPath(`index.html#/site`));
// win.loadFile(resolveHtmlPath('/index.html'), {
// hash: 'site',
// });
// win.loadURL(process.resourcesPath)
// win.webContents.openDevTools()
......
......@@ -7,7 +7,8 @@ export function resolveHtmlPath(htmlFileName: string) {
const port = process.env.PORT || 1212;
const url = new URL(`http://localhost:${port}`);
url.pathname = htmlFileName;
return url.href;
let goPath = url.href.replace('%23', '#')
return goPath;
}
return `file://${path.resolve(__dirname, '../renderer/', htmlFileName)}`;
}
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