yangjie #47
13
main.js
13
main.js
|
|
@ -29,6 +29,7 @@ let regKey;
|
|||
let connection = null;
|
||||
let envStr;
|
||||
let startNumber = 0;
|
||||
let buildStatus = false; //true 打包开发版本 false 本地开发
|
||||
powerSaveBlocker.start('prevent-display-sleep')
|
||||
const id = powerSaveBlocker.start('prevent-display-sleep')
|
||||
powerSaveBlocker.stop(id)
|
||||
|
|
@ -53,7 +54,11 @@ class AppWindow extends BrowserWindow {
|
|||
super(finalConfig);
|
||||
if (env === 'development') {
|
||||
// 开发
|
||||
this.loadURL('http://localhost:3000');
|
||||
if (buildStatus) {
|
||||
this.loadFile(path.resolve(__dirname, './dist/index.html'));
|
||||
} else {
|
||||
this.loadURL('http://localhost:3000');
|
||||
}
|
||||
} else {
|
||||
// 测试 | 生产
|
||||
this.loadFile(path.resolve(__dirname, './dist/index.html'));
|
||||
|
|
@ -584,7 +589,11 @@ app.on('ready', () => {
|
|||
})
|
||||
if (envStr === 'development') {
|
||||
// 开发
|
||||
child.loadURL(config.url)
|
||||
if (buildStatus) {
|
||||
child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`);
|
||||
} else {
|
||||
child.loadURL(config.url)
|
||||
}
|
||||
} else {
|
||||
// 测试 | 生产
|
||||
child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue