feat: Implement the ChatGPT Owner Demotion Console with new frontend and backend components.
This commit is contained in:
@@ -49,6 +49,9 @@ type Config struct {
|
||||
// 站点配置
|
||||
SiteName string `json:"site_name"`
|
||||
|
||||
// 母号降级配置
|
||||
DemoteAfterUse bool `json:"demote_after_use"` // 母号使用后自动降级
|
||||
|
||||
// 邮箱服务
|
||||
MailServices []MailServiceConfig `json:"mail_services"`
|
||||
}
|
||||
@@ -189,6 +192,9 @@ func InitFromDB() *Config {
|
||||
} else {
|
||||
cfg.AuthMethod = "browser" // 默认使用浏览器模式
|
||||
}
|
||||
if v, _ := configDB.GetConfig("demote_after_use"); v == "true" {
|
||||
cfg.DemoteAfterUse = true
|
||||
}
|
||||
|
||||
Global = cfg
|
||||
return cfg
|
||||
@@ -234,6 +240,8 @@ func SaveToDB() error {
|
||||
configDB.SetConfig("auth_method", cfg.AuthMethod)
|
||||
}
|
||||
|
||||
configDB.SetConfig("demote_after_use", strconv.FormatBool(cfg.DemoteAfterUse))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user