Files
pqs-9100_client/electron/config/config.default.js

86 lines
2.5 KiB
JavaScript
Raw Normal View History

2024-08-07 21:48:41 +08:00
'use strict';
const path = require('path');
2025-10-15 14:12:24 +08:00
const {getBaseDir} = require('ee-core/ps');
2024-08-07 21:48:41 +08:00
/**
* 默认配置
*/
2025-10-15 14:12:24 +08:00
module.exports = () => {
return {
openDevTools: false,
singleLock: true,
windowsOption: {
title: 'NPQS9100-自动检测平台',
2025-10-16 20:14:55 +08:00
menuBarVisible: true, // 显示菜单栏,方便查看日志
2025-10-15 14:12:24 +08:00
width: 1920,
height: 1000,
minWidth: 1024,
minHeight: 640,
webPreferences: {
//webSecurity: false,
contextIsolation: false, // false -> 可在渲染进程中使用electron的apitrue->需要bridge.js(contextBridge)
nodeIntegration: true,
//preload: path.join(getElectronDir(), 'preload', 'bridge.js'),
},
frame: true,
2025-10-16 20:14:55 +08:00
show: false, // 初始不显示,等待服务启动完成后再显示
2025-11-26 08:50:22 +08:00
icon: path.join(getBaseDir(), 'public', 'images', 'icon.png'),
2025-10-15 14:12:24 +08:00
},
logger: {
level: 'INFO',
outputJSON: false,
appLogName: '9100.log',
coreLogName: '9100-core.log',
errorLogName: '9100-error.log'
},
// 远程web地址
remote: {
enable: false,
url: ''
},
socketServer: {
enable: false,
port: 7070,
path: "/socket.io/",
connectTimeout: 45000,
pingTimeout: 30000,
pingInterval: 25000,
maxHttpBufferSize: 1e8,
transports: ["polling", "websocket"],
cors: {
origin: true,
},
channel: 'socket-channel'
},
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,
},
mainServer: {
indexPath: '/public/dist/index.html',
channelSeparator: '/',
2025-10-16 20:14:55 +08:00
},
// MySQL配置
mysql: {
enable: true,
autoStart: true, // 应用启动时自动启动MySQL
path: path.join(getBaseDir(), 'mysql'),
connection: {
host: 'localhost',
port: 3306,
user: 'root',
password: 'njcnpqs',
database: 'npqs9100_db',
charset: 'utf8mb4'
}
2025-10-15 14:12:24 +08:00
}
2024-08-07 21:48:41 +08:00
}
}