diff --git a/apis/system/captcha.go b/apis/system/captcha.go index a871960b..79ecc3a1 100644 --- a/apis/system/captcha.go +++ b/apis/system/captcha.go @@ -13,7 +13,7 @@ import ( */ func GenerateCaptchaHandler(c *gin.Context) { - id, b64s, err := captcha.DriverDigitFunc() + id, b64s, _, err := captcha.DriverDigitFunc() if err != nil { app.Error(c, -1, err, fmt.Sprintf("验证码获取失败, %v", err.Error())) return diff --git a/tools/captcha/captcha.go b/tools/captcha/captcha.go index 55dc8f88..e38a18aa 100644 --- a/tools/captcha/captcha.go +++ b/tools/captcha/captcha.go @@ -19,7 +19,7 @@ type configJsonBody struct { DriverDigit *base64Captcha.DriverDigit } -func DriverDigitFunc() (id, b64s string, err error) { +func DriverDigitFunc() (id, b64s, answer string, err error) { e := configJsonBody{} e.Id = uuid.New().String() e.DriverDigit = base64Captcha.NewDriverDigit(80, 240, 4, 0.7, 80)