diff --git a/main.go b/main.go index 547a109d9..cbbb6a2fc 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/mem" - _ "ThingsPanel-Go/grpc/protocol_plugin/server" + //_ "ThingsPanel-Go/grpc/protocol_plugin/server" _ "ThingsPanel-Go/cron" diff --git a/modules/dataService/dataService.go b/modules/dataService/dataService.go index 2340e7330..244c340f3 100644 --- a/modules/dataService/dataService.go +++ b/modules/dataService/dataService.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "log" "os" + "strings" "github.com/spf13/viper" ) @@ -39,6 +40,7 @@ func loadConfig() { viper.SetEnvPrefix("GOTP") // 使 Viper 能够读取环境变量 viper.AutomaticEnv() + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) viper.SetConfigFile(*envConfigFile) if err = viper.ReadInConfig(); err != nil { fmt.Println("FAILURE", err)