Skip to content

Commit

Permalink
feat: append config parameter: registerEnabled (cloudreve#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinsea authored May 29, 2021
1 parent 8659bdc commit c85c2da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/serializer/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type SiteConfig struct {
ReCaptchaKey string `json:"captcha_ReCaptchaKey"`
CaptchaType string `json:"captcha_type"`
TCaptchaCaptchaAppId string `json:"tcaptcha_captcha_app_id"`
RegisterEnabled bool `json:"registerEnabled"`
}

type task struct {
Expand Down Expand Up @@ -83,6 +84,7 @@ func BuildSiteConfig(settings map[string]string, user *model.User) Response {
ReCaptchaKey: checkSettingValue(settings, "captcha_ReCaptchaKey"),
CaptchaType: checkSettingValue(settings, "captcha_type"),
TCaptchaCaptchaAppId: checkSettingValue(settings, "captcha_TCaptcha_CaptchaAppId"),
RegisterEnabled: model.IsTrueVal(checkSettingValue(settings, "register_enabled")),
}}
return res
}
1 change: 1 addition & 0 deletions routers/controllers/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func SiteConfig(c *gin.Context) {
"captcha_ReCaptchaKey",
"captcha_type",
"captcha_TCaptcha_CaptchaAppId",
"register_enabled",
)

// 如果已登录,则同时返回用户信息和标签
Expand Down

0 comments on commit c85c2da

Please sign in to comment.