init项目
This commit is contained in:
60
electron/config/builder.json
Normal file
60
electron/config/builder.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"productName": "pqs9100",
|
||||
"appId": "com.njcn.pqs9100",
|
||||
"copyright": "hongawen.com",
|
||||
"directories": {
|
||||
"output": "out"
|
||||
},
|
||||
"asar": true,
|
||||
"files": [
|
||||
"**/*",
|
||||
"!frontend/",
|
||||
"!run/",
|
||||
"!logs/",
|
||||
"!data/"
|
||||
],
|
||||
"extraResources": {
|
||||
"from": "build/extraResources/",
|
||||
"to": "extraResources"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"allowElevation": true,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"installerIcon": "build/icons/icon.ico",
|
||||
"uninstallerIcon": "build/icons/icon.ico",
|
||||
"installerHeaderIcon": "build/icons/icon.ico",
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "自动检测平台"
|
||||
},
|
||||
"publish": [
|
||||
{
|
||||
"provider": "generic",
|
||||
"url": "http://www.shining-electric.com/"
|
||||
}
|
||||
],
|
||||
"mac": {
|
||||
"icon": "build/icons/icon.icns",
|
||||
"artifactName": "${productName}-${os}-${version}-${arch}.${ext}",
|
||||
"darkModeSupport": true,
|
||||
"hardenedRuntime": false
|
||||
},
|
||||
"win": {
|
||||
"icon": "build/icons/icon.ico",
|
||||
"artifactName": "${productName}-${os}-${version}-${arch}.${ext}",
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis"
|
||||
}
|
||||
]
|
||||
},
|
||||
"linux": {
|
||||
"icon": "build/icons/icon.icns",
|
||||
"artifactName": "${productName}-${os}-${version}-${arch}.${ext}",
|
||||
"target": [
|
||||
"deb"
|
||||
],
|
||||
"category": "Utility"
|
||||
}
|
||||
}
|
||||
185
electron/config/config.default.js
Normal file
185
electron/config/config.default.js
Normal file
@@ -0,0 +1,185 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* 默认配置
|
||||
*/
|
||||
module.exports = (appInfo) => {
|
||||
|
||||
const config = {};
|
||||
|
||||
/**
|
||||
* 开发者工具
|
||||
*/
|
||||
config.openDevTools = false;
|
||||
|
||||
/**
|
||||
* 应用程序顶部菜单
|
||||
*/
|
||||
config.openAppMenu = true;
|
||||
|
||||
/**
|
||||
* 1.507
|
||||
* 主窗口
|
||||
*/
|
||||
config.windowsOption = {
|
||||
title: '自动检测平台',
|
||||
width: 1280,
|
||||
height: 850,
|
||||
minWidth: 1280,
|
||||
minHeight: 850,
|
||||
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: 'pqs9100.log',
|
||||
coreLogName: 'pqs9100-core.log',
|
||||
errorLogName: 'pqs9100-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"], // http轮询和websocket
|
||||
cors: {
|
||||
origin: true, // http协议时,需要设置允许跨域
|
||||
},
|
||||
channel: 'c1' // 默认频道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' // 默认过滤的uri 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 // 是否打印进程间通信的消息log
|
||||
};
|
||||
|
||||
/**
|
||||
* 插件功能
|
||||
* @param window 官方内置插件
|
||||
* @param tray 托盘插件
|
||||
* @param security 安全插件
|
||||
* @param awaken 唤醒插件
|
||||
* @param autoUpdater 自动升级插件
|
||||
*/
|
||||
config.addons = {
|
||||
window: {
|
||||
enable: true,
|
||||
},
|
||||
tray: {
|
||||
enable: true,
|
||||
title: '自动检测平台',
|
||||
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: 'http://kodo.qiniu.com/'
|
||||
},
|
||||
force: false,
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
...config
|
||||
};
|
||||
}
|
||||
31
electron/config/config.local.js
Normal file
31
electron/config/config.local.js
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 开发环境配置,覆盖 config.default.js
|
||||
*/
|
||||
module.exports = (appInfo) => {
|
||||
const config = {};
|
||||
|
||||
/**
|
||||
* 开发者工具
|
||||
*/
|
||||
config.openDevTools = {
|
||||
mode: 'undocked'
|
||||
};
|
||||
|
||||
/**
|
||||
* 应用程序顶部菜单
|
||||
*/
|
||||
config.openAppMenu = true;
|
||||
|
||||
/**
|
||||
* jobs
|
||||
*/
|
||||
config.jobs = {
|
||||
messageLog: true
|
||||
};
|
||||
|
||||
return {
|
||||
...config
|
||||
};
|
||||
};
|
||||
29
electron/config/config.prod.js
Normal file
29
electron/config/config.prod.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 生产环境配置,覆盖 config.default.js
|
||||
*/
|
||||
module.exports = (appInfo) => {
|
||||
const config = {};
|
||||
|
||||
/**
|
||||
* 开发者工具
|
||||
*/
|
||||
config.openDevTools = false;
|
||||
|
||||
/**
|
||||
* 应用程序顶部菜单
|
||||
*/
|
||||
config.openAppMenu = false;
|
||||
|
||||
/**
|
||||
* jobs
|
||||
*/
|
||||
config.jobs = {
|
||||
messageLog: false
|
||||
};
|
||||
|
||||
return {
|
||||
...config
|
||||
};
|
||||
};
|
||||
13
electron/config/nodemon.json
Normal file
13
electron/config/nodemon.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"watch": [
|
||||
"electron/",
|
||||
"main.js"
|
||||
],
|
||||
"ignore": [],
|
||||
"ext": "js,json",
|
||||
"verbose": true,
|
||||
"exec": "electron . --env=local --hot-reload=1",
|
||||
"restartable": "hr",
|
||||
"colours": true,
|
||||
"events": {}
|
||||
}
|
||||
Reference in New Issue
Block a user