🐛修复了一些bug
This commit is contained in:
parent
cad482fd25
commit
eed038bf01
@ -3,7 +3,6 @@ package component
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"wireguard-dashboard/client"
|
"wireguard-dashboard/client"
|
||||||
@ -50,8 +49,8 @@ func (CaptchaStore) Get(id string, clear bool) string {
|
|||||||
// @param clear
|
// @param clear
|
||||||
// @return bool
|
// @return bool
|
||||||
func (c CaptchaStore) Verify(id, answer string, clear bool) bool {
|
func (c CaptchaStore) Verify(id, answer string, clear bool) bool {
|
||||||
if os.Getenv("GIN_MODE") != "release" {
|
//if os.Getenv("GIN_MODE") != "release" {
|
||||||
return true
|
// return true
|
||||||
}
|
//}
|
||||||
return strings.ToUpper(answer) == strings.ToUpper(c.Get(id, clear))
|
return strings.ToUpper(answer) == strings.ToUpper(c.Get(id, clear))
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ func Captcha() captcha {
|
|||||||
// @receiver captcha
|
// @receiver captcha
|
||||||
// @param c
|
// @param c
|
||||||
func (captcha) GenerateCaptcha(c *gin.Context) {
|
func (captcha) GenerateCaptcha(c *gin.Context) {
|
||||||
math := base64Captcha.DriverMath{Height: 60, Width: 240, Fonts: []string{"ApothecaryFont.ttf", "3Dumb.ttf"}}
|
math := base64Captcha.DriverMath{Height: 120, Width: 480, Fonts: []string{"ApothecaryFont.ttf", "3Dumb.ttf"}}
|
||||||
mathDriver := math.ConvertFonts()
|
mathDriver := math.ConvertFonts()
|
||||||
|
|
||||||
capt := base64Captcha.NewCaptcha(mathDriver, component.CaptchaStore{})
|
capt := base64Captcha.NewCaptcha(mathDriver, component.CaptchaStore{})
|
||||||
|
Loading…
Reference in New Issue
Block a user