diff --git a/global/config.go b/global/config.go index 88f5804..0abf933 100644 --- a/global/config.go +++ b/global/config.go @@ -277,8 +277,8 @@ func DefaultConfig() *JSONConfig { } } -//Load 加载配置文件 -func Load(p string) *JSONConfig { +//LoadConfig 加载配置文件 +func LoadConfig(p string) *JSONConfig { if !PathExists(p) { log.Warnf("尝试加载配置文件 %v 失败: 文件不存在", p) return nil diff --git a/main.go b/main.go index 6b0dd23..58adfc5 100644 --- a/main.go +++ b/main.go @@ -469,7 +469,7 @@ func restart(Args []string) { func getConfig() *global.JSONConfig { var conf *global.JSONConfig if global.PathExists("config.json") { - conf = global.Load("config.json") + conf = global.LoadConfig("config.json") _ = conf.Save("config.hjson") _ = os.Remove("config.json") } else if os.Getenv("UIN") != "" { @@ -498,7 +498,7 @@ func getConfig() *global.JSONConfig { conf.HTTPConfig.PostUrls[post] = os.Getenv("HTTP_SECRET") } } else { - conf = global.Load("config.hjson") + conf = global.LoadConfig("config.hjson") } if conf == nil { err := global.WriteAllText("config.hjson", global.DefaultConfigWithComments) diff --git a/server/apiAdmin.go b/server/apiAdmin.go index deab769..c871e3d 100644 --- a/server/apiAdmin.go +++ b/server/apiAdmin.go @@ -333,7 +333,7 @@ func GetConf() *global.JSONConfig { if JSONConfig != nil { return JSONConfig } - conf := global.Load("config.hjson") + conf := global.LoadConfig("config.hjson") return conf }