Feat: ReCaptcha support (#292)

* Add custom mysql database port.

* Modify: add cloudreve bin file to .gitignore

* Feat:增加后端对ReCaptcha的支持
P.S.必须要执行迁移
This commit is contained in:
topjohncian
2020-04-11 09:09:44 +08:00
committed by GitHub
parent fa900b166a
commit e58fb82463
8 changed files with 235 additions and 4 deletions

View File

@@ -15,6 +15,8 @@ type SiteConfig struct {
ShareViewMethod string `json:"share_view_method"`
Authn bool `json:"authn"'`
User User `json:"user"`
UseReCaptcha bool `json:"captcha_IsUseReCaptcha"`
ReCaptchaKey string `json:"captcha_ReCaptchaKey"`
}
type task struct {
@@ -72,6 +74,8 @@ func BuildSiteConfig(settings map[string]string, user *model.User) Response {
ShareViewMethod: checkSettingValue(settings, "share_view_method"),
Authn: model.IsTrueVal(checkSettingValue(settings, "authn_enabled")),
User: userRes,
UseReCaptcha: model.IsTrueVal(checkSettingValue(settings, "captcha_IsUseReCaptcha")),
ReCaptchaKey: checkSettingValue(settings, "captcha_ReCaptchaKey"),
}}
return res
}