获取配置文件对象;该对象根据当前环境变量的不同,返回的结果不同。
使用方法:
this.app.config
env
name
baseDir
框架中electron目录路径。如果使用加密功能,打包后路径为 ./public/electron
HOME
homeDir
root
appUserDataDir
userHome
appVersion
isPackaged
execDir
logger
socketServer
developmentMode
openDevTools
openAppMenu
loadingPage
windowsOption
remoteUrl
autoUpdate
awakeProtocol
tray
testConfig
用户自定义配置
config值举例:
# 值
{
"env": "local",
"name": "ee",
"baseDir": "D:\\www\\xing\\ee\\electron",
"HOME": "D:\\www\\xing\\ee",
"rundir": "D:\\www\\xing\\ee\\electron\\run",
"dump": {
"ignore": {}
},
"homeDir": "D:\\www\\xing\\ee",
"root": "D:\\www\\xing\\ee",
"appUserDataDir": "C:\\Users\\gaoshuaixing\\AppData\\Roaming\\ee",
"userHome": "C:\\Users\\gaoshuaixing",
"appVersion": "2.0.3",
"isPackaged": false,
"execDir": "D:\\www\\xing\\ee",
"logger": {
"dir": "D:\\www\\xing\\ee\\logs",
"encoding": "utf8",
"env": "local",
"level": "INFO",
"consoleLevel": "INFO",
"disableConsoleAfterReady": false,
"outputJSON": false,
"buffer": true,
"appLogName": "ee-2022-03-04.log",
"coreLogName": "ee-core.log",
"agentLogName": "ee-agent.log",
"errorLogName": "ee-error-2022-03-04.log",
"coreLogger": {},
"allowDebugAtProd": false,
"enablePerformanceTimer": false,
"type": "application"
},
"httpclient": {
"enableDNSCache": false,
"dnsCacheLookupInterval": 10000,
"dnsCacheMaxLength": 1000,
"request": {
"timeout": 5000
},
"httpAgent": {
"keepAlive": true,
"freeSocketTimeout": 4000,
"maxSockets": 9007199254740991,
"maxFreeSockets": 256
},
"httpsAgent": {
"keepAlive": true,
"freeSocketTimeout": 4000,
"maxSockets": 9007199254740991,
"maxFreeSockets": 256
}
},
"socketServer": {
"port": 7070,
"isDynamic": false
},
"developmentMode": {
"default": "vue",
"mode": {
"vue": {
"hostname": "localhost",
"port": 8080
},
"react": {
"hostname": "localhost",
"port": 3000
},
"html": {
"hostname": "localhost",
"indexPage": "index.html"
}
}
},
"openDevTools": false,
"openAppMenu": true,
"loadingPage": true,
"windowsOption": {
"width": 980,
"height": 650,
"minWidth": 800,
"minHeight": 650,
"webPreferences": {
"contextIsolation": false,
"nodeIntegration": true
},
"frame": true
},
"remoteUrl": {
"enable": false,
"url": "https://discuz.chat/"
},
"autoUpdate": {
"windows": false,
"macOS": false,
"linux": false,
"options": {
"provider": "generic",
"url": "http://kodo.qiniu.com/"
},
"force": false
},
"awakeProtocol": {
"protocol": "ee",
"args": []
},
"tray": {
"title": "EE程序",
"icon": "/public/images/tray_logo.png"
},
"testConfig": {
"login": "http://local.com/api/login"
},
"coreMiddlewares": [],
"coreMiddleware": [],
"appMiddlewares": [],
"appMiddleware": []
}