first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
const { app, BrowserWindow, ipcMain, Menu } = require('electron')
const path = require('path')
var index = 0;
var mainWindow = null;
var config = [
{
path: 'page/login.html',
windowConfig: {
title: '乐聊 - 登录',
width: 316,
height: 507,
resizable: false,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true,
contextIsolation: false
}
}
},
{
path: 'page/index.html',
windowConfig: {
title: '',
icon: null,
width: 800,
height: 600,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true,
contextIsolation: false
}
}
}
];
const createWindow = () => {
Menu.setApplicationMenu(null);
mainWindow = new BrowserWindow(config[index].windowConfig)
mainWindow.webContents.openDevTools();
mainWindow.loadFile(config[index].path)
}
ipcMain.on("GoToIndex",(action, res) => {
mainWindow.close();
index = 1;
createWindow()
})
app.whenReady().then(() => {
createWindow()
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})