update
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
+7
-8
@@ -1,6 +1,9 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
// 远程服务器地址(数据与此服务器同步)
|
||||
const SERVER_URL = 'http://47.104.244.29:3001';
|
||||
|
||||
let mainWindow;
|
||||
|
||||
function createWindow() {
|
||||
@@ -10,7 +13,7 @@ function createWindow() {
|
||||
minWidth: 1024,
|
||||
minHeight: 680,
|
||||
title: '影视星河设备管理系统',
|
||||
icon: path.join(__dirname, 'icon.ico'),
|
||||
icon: path.join(__dirname, 'icon.png'),
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true
|
||||
@@ -18,8 +21,8 @@ function createWindow() {
|
||||
autoHideMenuBar: true
|
||||
});
|
||||
|
||||
// 加载本地服务器
|
||||
mainWindow.loadURL('http://localhost:3001');
|
||||
// 加载远程服务器页面
|
||||
mainWindow.loadURL(SERVER_URL);
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null;
|
||||
@@ -27,11 +30,7 @@ function createWindow() {
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
// 启动后端服务器
|
||||
require('../server.js');
|
||||
|
||||
// 等待服务器启动后创建窗口
|
||||
setTimeout(createWindow, 1500);
|
||||
createWindow();
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
Reference in New Issue
Block a user