From cf45483a33dee79b4582f4a838f2cba0420c7f8e Mon Sep 17 00:00:00 2001 From: gaoshuaixing Date: Mon, 16 Dec 2024 16:17:57 +0800 Subject: [PATCH] chore: config --- electron/config/config.default.js | 39 +++---------------------------- electron/config/config.local.js | 25 ++++++++++++++------ electron/config/config.prod.js | 29 ++++++++++++++++------- yalc.lock | 2 +- 4 files changed, 43 insertions(+), 52 deletions(-) diff --git a/electron/config/config.default.js b/electron/config/config.default.js index 9f355a2..8c414ab 100644 --- a/electron/config/config.default.js +++ b/electron/config/config.default.js @@ -6,7 +6,7 @@ const path = require('path'); * 默认配置 */ module.exports = (appInfo) => { - + console.log("appInfo:", appInfo); const config = {}; /** @@ -32,11 +32,11 @@ module.exports = (appInfo) => { //webSecurity: false, contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge) nodeIntegration: true, - //preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'), + //preload: path.join('preload', 'bridge.js'), }, frame: true, show: false, - icon: path.join(appInfo.home, 'public', 'images', 'logo-32.png'), + icon: path.join('public', 'images', 'logo-32.png'), }; /** @@ -140,39 +140,6 @@ module.exports = (appInfo) => { messageLog: true }; - /** - * 插件功能 - */ - config.addons = { - window: { - enable: true, - }, - tray: { - enable: true, - title: 'EE程序', - 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 }; diff --git a/electron/config/config.local.js b/electron/config/config.local.js index 69938ca..975beb6 100644 --- a/electron/config/config.local.js +++ b/electron/config/config.local.js @@ -3,7 +3,7 @@ /** * 开发环境配置,覆盖 config.default.js */ -module.exports = (appInfo) => { +module.exports = () => { const config = {}; /** @@ -16,14 +16,25 @@ module.exports = (appInfo) => { /** * 应用程序顶部菜单 */ - config.openAppMenu = true; + config.openAppMenu = false; /** - * jobs - */ - config.jobs = { - messageLog: true - }; + * 内置socket服务 + */ + config.socketServer = { + enable: false, + port: 7071, + path: "/socket.io/", + connectTimeout: 45000, + pingTimeout: 30000, + pingInterval: 25000, + maxHttpBufferSize: 1e8, + transports: ["polling", "websocket"], + cors: { + origin: false, + }, + channel: 'c1' + }; return { ...config diff --git a/electron/config/config.prod.js b/electron/config/config.prod.js index 5c5218d..975beb6 100644 --- a/electron/config/config.prod.js +++ b/electron/config/config.prod.js @@ -1,15 +1,17 @@ 'use strict'; /** - * 生产环境配置,覆盖 config.default.js + * 开发环境配置,覆盖 config.default.js */ -module.exports = (appInfo) => { +module.exports = () => { const config = {}; /** * 开发者工具 */ - config.openDevTools = false; + config.openDevTools = { + mode: 'undocked' + }; /** * 应用程序顶部菜单 @@ -17,11 +19,22 @@ module.exports = (appInfo) => { config.openAppMenu = false; /** - * jobs - */ - config.jobs = { - messageLog: false - }; + * 内置socket服务 + */ + config.socketServer = { + enable: false, + port: 7071, + path: "/socket.io/", + connectTimeout: 45000, + pingTimeout: 30000, + pingInterval: 25000, + maxHttpBufferSize: 1e8, + transports: ["polling", "websocket"], + cors: { + origin: false, + }, + channel: 'c1' + }; return { ...config diff --git a/yalc.lock b/yalc.lock index 530441b..f01b30f 100644 --- a/yalc.lock +++ b/yalc.lock @@ -16,7 +16,7 @@ "replaced": "^0.1.0-beta.3" }, "ee-core": { - "signature": "4076fc4dc98ed3cc7ef7e6ba39889f03", + "signature": "dc2e5e7735ddeabcf1a93c704f930909", "file": true } }