2021-09-14 07:31:59 +08:00
|
|
|
import { app, BrowserWindow } from 'electron'
|
|
|
|
|
import { join } from "path"
|
|
|
|
|
|
2021-09-27 08:53:46 +08:00
|
|
|
const URL = (process.env.NODE_ENV === 'development') ? 'http://localhost:3000/' : 'http://gnss.cesium.hwasmart.com/'
|
2021-09-14 07:31:59 +08:00
|
|
|
|
|
|
|
|
function createWindow() {
|
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
|
fullscreen: true,
|
|
|
|
|
frame: false,
|
|
|
|
|
webPreferences: {
|
|
|
|
|
nodeIntegration: true,
|
|
|
|
|
preload: join(__dirname, 'preload.js')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
win.loadURL(URL)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.whenReady().then(createWindow)
|
|
|
|
|
|
|
|
|
|
app.on('window-all-closed', () => {
|
|
|
|
|
if (process.platform !== 'darwin') {
|
|
|
|
|
app.quit()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
app.on('activate', () => {
|
|
|
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
|
|
|
createWindow()
|
|
|
|
|
}
|
|
|
|
|
})
|