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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
| 'use strict';
|
| const path = require('path');
|
| /**
| * 默认配置
| */
| module.exports = (appInfo) => {
|
| const config = {};
|
| /**
| * 开发者工具
| */
| config.openDevTools = false;
|
| /**
| * 应用程序顶部菜单
| */
| config.openAppMenu = false;
|
| /**
| * 主窗口
| */
| config.windowsOption = {
| title: '智能IC卡读写程序',
| width: 980,
| height: 650,
| minWidth: 400,
| minHeight: 300,
| webPreferences: {
| //webSecurity: false,
| contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
| nodeIntegration: true,
| //preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'),
| },
| frame: true,
| show: false,
| icon: path.join(appInfo.home, 'public', 'images', 'logo-32.png'),
| };
|
| /**
| * ee框架日志
| */
| config.logger = {
| encoding: 'utf8',
| level: 'INFO',
| outputJSON: false,
| buffer: true,
| enablePerformanceTimer: false,
| rotator: 'day',
| appLogName: 'ee.log',
| coreLogName: 'ee-core.log',
| errorLogName: 'ee-error.log'
| }
|
| /**
| * 远程模式-web地址
| */
| config.remoteUrl = {
| enable: false,
| url: 'http://electron-egg.kaka996.com/'
| };
|
| /**
| * 内置socket服务
| */
| config.socketServer = {
| enable: false,
| port: 7070,
| path: "/socket.io/",
| connectTimeout: 45000,
| pingTimeout: 30000,
| pingInterval: 25000,
| maxHttpBufferSize: 1e8,
| transports: ["polling", "websocket"],
| cors: {
| origin: true,
| },
| channel: 'c1'
| };
|
| /**
| * 内置http服务
| */
| config.httpServer = {
| enable: false,
| https: {
| enable: false,
| key: '/public/ssl/localhost+1.key',
| cert: '/public/ssl/localhost+1.pem'
| },
| host: '127.0.0.1',
| port: 7071,
| cors: {
| origin: "*"
| },
| body: {
| multipart: true,
| formidable: {
| keepExtensions: true
| }
| },
| filterRequest: {
| uris: [
| 'favicon.ico'
| ],
| returnData: ''
| }
| };
|
| /**
| * 主进程
| */
| config.mainServer = {
|
| protocol: 'file://',
| indexPath: '/public/dist/index.html',
| };
|
|
|
| /**
| * 硬件加速
| */
| config.hardGpu = {
| enable: true
| };
|
| /**
| * 异常捕获
| */
| config.exception = {
| mainExit: false,
| childExit: true,
| rendererExit: true,
| };
|
| /**
| * jobs
| */
| config.jobs = {
| messageLog: true
| };
|
| /**
| * 插件功能
| */
| config.addons = {
| window: {
| enable: true,
| },
| tray: {
| enable: true,
| title: '智能IC卡读写程序',
| icon: '/public/images/tray.png'
| },
| security: {
| enable: true,
| },
| awaken: {
| enable: true,
| protocol: 'ee',
| args: []
| },
| autoUpdater: {
| enable: true,
| windows: false,
| macOS: false,
| linux: false,
| options: {
| provider: 'generic',
| url: ''
| },
| force: false,
| }
| };
|
| return {
| ...config
| };
| }
|
|