🎨 访问授权码输入错误 3 次后加入验证码 https://github.com/siyuan-note/siyuan/issues/5429

This commit is contained in:
Liang Ding 2022-07-16 16:41:40 +08:00
parent e675bc260d
commit a32e2eb1c0
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -71,7 +71,7 @@ func LoginAuth(c *gin.Context) {
}
inputCaptcha = captchaArg.(string)
if session.Captcha != inputCaptcha {
if strings.ToLower(session.Captcha) != strings.ToLower(inputCaptcha) {
ret.Code = 1
ret.Msg = Conf.Language(22)
return
@ -109,10 +109,9 @@ func LoginAuth(c *gin.Context) {
func GetCaptcha(c *gin.Context) {
img, err := captcha.New(100, 26, func(options *captcha.Options) {
options.CharPreset = "abcdefghjkmnpqrtuvwxyz2346789"
options.CharPreset = "ABCDEFGHKLMNPQRSTUVWXYZ23456789"
options.Noise = 0.5
options.CurveNumber = 0
options.FontScale = 1.2
})
if nil != err {
util.LogErrorf("generates captcha failed: " + err.Error())