验证码调整成为数字验证码

This commit is contained in:
zhangwenjian committed 2020-04-06 14:36:49 +08:00
1 parent f2d5efbb61
commit 94cb94df63
1 file changed
+5 -4
+5 -4
View File
@@ -4,7 +4,6 @@ import (
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/mojocn/base64Captcha"
"image/color"
"net/http"
)
@@ -26,9 +25,11 @@ func GenerateCaptchaHandler(c *gin.Context) {
var param configJsonBody
param.Id = uuid.New().String()
param.CaptchaType = "string"
param.DriverString = base64Captcha.NewDriverString(46, 140, 2, 2, 4, "234567890abcdefghjkmnpqrstuvwxyz", &color.RGBA{240, 240, 246, 246}, []string{"wqy-microhei.ttc"})
driver := param.DriverString.ConvertFonts()
//param.CaptchaType = "string"
param.DriverDigit = base64Captcha.DefaultDriverDigit
driver := param.DriverDigit
//param.DriverString = base64Captcha.NewDriverString(46, 140, 2, 2, 4, "234567890abcdefghjkmnpqrstuvwxyz", &color.RGBA{240, 240, 246, 246}, []string{"wqy-microhei.ttc"})
//driver := param.DriverString.ConvertFonts()
cap := base64Captcha.NewCaptcha(driver, store)
id, b64s, err := cap.Generate()