Commit b80acaa2 authored by rocosen's avatar rocosen

Update main.ts

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