|
|
@ -31,8 +31,9 @@ import md5 from 'md5'; |
|
|
|
class HeroUnion { |
|
|
|
class HeroUnion { |
|
|
|
|
|
|
|
|
|
|
|
//构造函数,设置默认配置
|
|
|
|
//构造函数,设置默认配置
|
|
|
|
constructor() { |
|
|
|
constructor(configFilename) { |
|
|
|
this.config = null; |
|
|
|
this.config = null; |
|
|
|
|
|
|
|
this.configFile = typeof(configFilename) != 'undefined' && configFilename ? configFilename : 'config.json'; |
|
|
|
|
|
|
|
|
|
|
|
//默认配置
|
|
|
|
//默认配置
|
|
|
|
this.systemLogDir = 'log/'; //系统日志保存目录
|
|
|
|
this.systemLogDir = 'log/'; //系统日志保存目录
|
|
|
@ -100,7 +101,8 @@ class HeroUnion { |
|
|
|
const _self = this; |
|
|
|
const _self = this; |
|
|
|
|
|
|
|
|
|
|
|
if ( !this.config || (typeof(forceReload) != 'undefined' && forceReload) ) { |
|
|
|
if ( !this.config || (typeof(forceReload) != 'undefined' && forceReload) ) { |
|
|
|
let config = await common.getConfigFromJsonFile('config.json'); |
|
|
|
common.log("Load config from %s", this.configFile); |
|
|
|
|
|
|
|
let config = await common.getConfigFromJsonFile(this.configFile); |
|
|
|
|
|
|
|
|
|
|
|
//覆盖默认配置
|
|
|
|
//覆盖默认配置
|
|
|
|
for (const key in config) { |
|
|
|
for (const key in config) { |
|
|
|