Commit b80acaa2 authored by rocosen's avatar rocosen

Update main.ts

parent c0ae1dcd
......@@ -37,15 +37,17 @@ function urls(per: any) {
pathname: resolve(__dirname, 'assets', 'index.html'),
})
// win.resize(size2Width(), size2Height())
if (isDev) {
opts = `http://localhost:1212`
}
// if (isDev) {
// opts = `http://localhost:1212`
// }
console.log('opts: ', opts);
return opts + per
}
const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:1212`
: `file://${__dirname}/assets/index.html`
: `file://${path.resolve(__dirname, '../renderer/')}`
ipcMain.on('resize-site', (event) => {
if (win) {
......@@ -70,7 +72,11 @@ ipcMain.on('createNewWindow', () => {
// parent: win, //win是主窗口
});
// win.loadURL(path.join('file:', __dirname, 'new.html')); //new.html是新开窗口的渲染进程
win.loadURL(urls('#/site'));
win.loadURL(winURL);
// win.loadURL(process.resourcesPath)
// win.webContents.openDevTools()
// win.loadFile(path.join(__dirname));
// win.loadFile('./index.html', {
// hash: 'site',
......
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