obtains the configuration file object. The object returns different results depending on the current environment variable.
Usage
this.app.config
env
environment variables: local、prod
name
baseDir
the path of the ‘./electron’ directory in the framework. If encryption is used, the path after packaging is ‘./public/electron’
HOME
homeDir
root
the data directory of the APP in the operating system varies according to environment variables.
appUserDataDir
the data directory of the APP in the operating system, independent of environment variables.
userHome
The home directory of the operating system user.
appVersion
isPackaged
execDir
after the APP is installed, the root directory of the executable programs (exe, dmg, dep)
logger
socketServer
built-in socket service configuration
developmentMode
openDevTools
openAppMenu
loadingPage
windowsOption
main window attribute configuration
remoteUrl
autoUpdate
automatic upgrade configuration
awakeProtocol
Wake-up protocol configuration
tray
testConfig
user-defined configuration
example of config value:
{
"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": []
}