From 8f3720d16d9d01c0d6836378c902fd304867404b Mon Sep 17 00:00:00 2001 From: hezhuozhuo <“421045249@qq.com”> Date: Mon, 18 Sep 2023 16:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 2 +- modules/dataService/dataService.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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)