Browse Source

fix: 解决使用docker运行获取秘钥异常的问题 (#263)

二丫讲梵 1 year ago
parent
commit
5d208ab3b7
1 changed files with 3 additions and 4 deletions
  1. 3 4
      config/config.go

+ 3 - 4
config/config.go

@@ -34,7 +34,7 @@ type Configuration struct {
 	// 会话超时时间
 	SessionTimeout time.Duration `yaml:"session_timeout"`
 	// 最大问题长度
-  	MaxQuestionLen int `yaml:"max_question_len"`
+	MaxQuestionLen int `yaml:"max_question_len"`
 	// 最大答案长度
 	MaxAnswerLen int `yaml:"max_answer_len"`
 	// 最大文本 = 问题 + 回答, 接口限制
@@ -224,11 +224,10 @@ func LoadConfig() *Configuration {
 		if azureOpenaiToken != "" {
 			config.AzureOpenAIToken = azureOpenaiToken
 		}
+
 		credentials := os.Getenv("DINGTALK_CREDENTIALS")
 		if credentials != "" {
-			if config.Credentials == nil {
-				config.Credentials = []Credential{}
-			}
+			config.Credentials = []Credential{}
 			for _, idSecret := range strings.Split(credentials, ",") {
 				items := strings.SplitN(idSecret, ":", 2)
 				if len(items) == 2 {