mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-07 01:33:43 +08:00
opt: optimize the layout for regiseter page. add function to disable registration
This commit is contained in:
@@ -52,12 +52,17 @@ func (h *ConfigHandler) Update(c *gin.Context) {
|
||||
// update config cache for AppServer
|
||||
var cfg model.Config
|
||||
h.db.Where("marker", data.Key).First(&cfg)
|
||||
err := utils.JsonDecode(cfg.Config, &h.App.ChatConfig)
|
||||
var err error
|
||||
if data.Key == "system" {
|
||||
err = utils.JsonDecode(cfg.Config, &h.App.SysConfig)
|
||||
} else if data.Key == "chat" {
|
||||
err = utils.JsonDecode(cfg.Config, &h.App.ChatConfig)
|
||||
}
|
||||
if err != nil {
|
||||
resp.ERROR(c, "Failed to update config cache: "+err.Error())
|
||||
return
|
||||
}
|
||||
logger.Debugf("Update AppServer's config successfully: %v", config.Config)
|
||||
logger.Infof("Update AppServer's config successfully: %v", config.Config)
|
||||
}
|
||||
|
||||
resp.SUCCESS(c, config)
|
||||
|
||||
Reference in New Issue
Block a user