| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- 'use strict';
- const path = require('path');
- /**
- * 默认配置
- */
- module.exports = (appInfo) => {
- const config = {};
- /**
- * 开发者工具
- */
- config.openDevTools = false;
- /**
- * 应用程序顶部菜单
- */
- config.openAppMenu = false;
- /**
- * 主窗口
- */
- config.windowsOption = {
- title: '智惠映AI自动拍照机',
- width: 3840,
- height: 2160,
- minWidth: 400,
- minHeight: 300,
- frame: true,
- // fullscreen: true,
- // titleBarStyle: 'hiddenInset', // 部分系统可能需要自定义标题栏样式
- webPreferences: {
- webSecurity: false,
- contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
- nodeIntegration: true,
- // preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'),
- },
- show: false,
- icon: path.join(appInfo.home, 'public', 'images', 'logo-32.png'),
- // 添加全屏配置
- // fullscreen: true, // 启用全屏
- // resizable: false // 禁用窗口缩放(全屏时通常不需要)
- };
- /**
- * 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://localhost:3000'
- };
- /**
- * 内置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",
- };
- /**
- * Cross-language service
- * 跨语言服务
- * 例如:执行go的二进制程序,默认目录为 ./extraResources/
- */
- config.cross = {
- go: {
- enable: false,
- name: "goapp",
- args: ["--port=7073"],
- appExit: true,
- },
- python: {
- enable: false,
- name: "pyapp",
- cmd: "./py/pyapp",
- directory: "./py",
- args: ["--port=7074"],
- appExit: true,
- },
- };
- /**
- * 内置http服务
- */
- config.httpServer = {
- enable: true,
- 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: "智惠映AI自动拍照机",
- 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,
- };
- }
|