fix: revert hide ask ai button (#1539)

This commit is contained in:
boojack
2023-04-16 10:55:44 +08:00
committed by GitHub
parent 58fa00079b
commit 73b8d1dd99
9 changed files with 36 additions and 63 deletions

View File

@@ -56,10 +56,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
},
StorageServiceID: api.DatabaseStorage,
LocalStoragePath: "",
OpenAIConfig: api.OpenAIConfig{
Key: "",
Host: "",
},
}
systemSettingList, err := s.Store.FindSystemSettingList(ctx, &api.SystemSettingFind{})
@@ -99,13 +95,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
systemStatus.StorageServiceID = int(baseValue.(float64))
} else if systemSetting.Name == api.SystemSettingLocalStoragePathName {
systemStatus.LocalStoragePath = baseValue.(string)
} else if systemSetting.Name == api.SystemSettingOpenAIConfigName {
openAIConfig := api.OpenAIConfig{}
err := json.Unmarshal([]byte(systemSetting.Value), &openAIConfig)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal system setting open ai config value").SetInternal(err)
}
systemStatus.OpenAIConfig = openAIConfig
}
}