Files

45 lines
900 B
JavaScript
Raw Permalink Normal View History

2026-08-10 22:56:38 +08:00
const { app, BrowserWindow } = require('electron');
const path = require('path');
2026-08-11 10:03:40 +08:00
// 远程服务器地址(数据与此服务器同步)
const SERVER_URL = 'http://47.104.244.29:3001';
2026-08-10 22:56:38 +08:00
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1400,
height: 900,
minWidth: 1024,
minHeight: 680,
title: '影视星河设备管理系统',
2026-08-11 10:03:40 +08:00
icon: path.join(__dirname, 'icon.png'),
2026-08-10 22:56:38 +08:00
webPreferences: {
nodeIntegration: false,
contextIsolation: true
},
autoHideMenuBar: true
});
2026-08-11 10:03:40 +08:00
// 加载远程服务器页面
mainWindow.loadURL(SERVER_URL);
2026-08-10 22:56:38 +08:00
mainWindow.on('closed', () => {
mainWindow = null;
});
}
app.whenReady().then(() => {
2026-08-11 10:03:40 +08:00
createWindow();
2026-08-10 22:56:38 +08:00
});
app.on('window-all-closed', () => {
app.quit();
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});