使用viper读取配置

This commit is contained in:
TsMask
2023-08-29 16:10:57 +08:00
parent d5f4483fe9
commit 40d3d05126
4 changed files with 105 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"strings"
"ems.agt/lib/core/conf"
"ems.agt/lib/global"
"ems.agt/lib/log"
@@ -327,6 +328,9 @@ func init() {
os.Exit(0)
}
// 使用viper读取配置
conf.InitConfig(*cfile)
ReadConfig(*cfile)
if GetYamlConfig().OMC.UriPrefix != "" {
UriPrefix = GetYamlConfig().OMC.UriPrefix