-
Notifications
You must be signed in to change notification settings - Fork 750
/
app.js
53 lines (42 loc) · 1.33 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'use strict';
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
// 导入模块
const Menubar = require('./modules/menubar');
const Request = require('./modules/request');
const Database = require('./modules/database');
const Cache = require('./modules/cache');
// electron.crashReporter.start();
app
.on('window-all-closed', app.quit)
.on('ready', () => {
let mainWindow = new BrowserWindow({
width: 1040,
height: 699,
minWidth: 1040,
minHeight: 699,
webgl: false,
title: 'AntSword',
// autoHideMenuBar: true,
// transparent: false,
// frame: false
// resizable: false
});
mainWindow.loadURL(`file:\/\/${__dirname}/views/index.html`);
mainWindow
.on('closed', () => { mainWindow = null })
.on('maximize', mainWindow.webContents.reload)
.on('unmaximize', mainWindow.webContents.reload)
.on('enter-full-screen', mainWindow.webContents.reload)
.on('leave-full-screen', mainWindow.webContents.reload)
// 打开调试控制台
// mainWindow.webContents.openDevTools();
new Menubar(electron, app, mainWindow);
// 监听Request请求
new Request(electron);
// 初始化数据库
new Database(electron);
// 初始化缓存模块
new Cache(electron);
});