first commit

This commit is contained in:
mei
2026-08-10 22:56:38 +08:00
commit 2086bd79cc
32 changed files with 14110 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1400,
height: 900,
minWidth: 1024,
minHeight: 680,
title: '影视星河设备管理系统',
icon: path.join(__dirname, 'icon.ico'),
webPreferences: {
nodeIntegration: false,
contextIsolation: true
},
autoHideMenuBar: true
});
// 加载本地服务器
mainWindow.loadURL('http://localhost:3001');
mainWindow.on('closed', () => {
mainWindow = null;
});
}
app.whenReady().then(() => {
// 启动后端服务器
require('../server.js');
// 等待服务器启动后创建窗口
setTimeout(createWindow, 1500);
});
app.on('window-all-closed', () => {
app.quit();
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});