提交 3a125308 编写于 作者: M muwoo

feat: bugfix

上级 1d7c2f59
import {globalShortcut, ipcMain, BrowserWindow} from 'electron';
import {stringify} from 'query-string';
import Api from './api';
import path from 'path';
export default function init(mainWindow) {
ipcMain.on('changeWindowSize', (event, arg) => {
......@@ -33,7 +34,7 @@ export default function init(mainWindow) {
}
const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080/#/plugin?${stringify(opts)}`
: `file://${__dirname}/index.html/#/plugin?${stringify(opts)}`
: `${__dirname}/index.html`
const win = new BrowserWindow({
height: 600,
useContentSize: true,
......@@ -48,7 +49,9 @@ export default function init(mainWindow) {
nodeIntegration: true // 在网页中集成Node
}
});
win.loadURL(winURL)
process.env.NODE_ENV === 'development' ? win.loadURL(winURL) : win.loadFile(winURL, {
hash: `#/plugin?${stringify(opts)}`,
});
win.once('ready-to-show', () => win.show());
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册