增加验证码功能

This commit is contained in:
pixel
2020-03-17 17:18:47 +08:00
parent 7b1d7ef6b1
commit 2d334baea5
5 changed files with 2 additions and 74 deletions

View File

@@ -25,7 +25,7 @@ func GinCapthcaServeHTTP(w http.ResponseWriter, r *http.Request) {
}
lang := strings.ToLower(r.FormValue("lang"))
download := path.Base(dir) == "download"
if Serve(w, r, id, ext, lang, download, captcha.StdWidth, captcha.StdHeight) == captcha.ErrNotFound {
if Serve(w, r, id, ext, lang, download, 120, 40) == captcha.ErrNotFound {
http.NotFound(w, r)
}
}