commit
continuous-integration/drone/push Build is passing Details

master
黄海 4 years ago
parent 265600486f
commit ddfc6fda53

@ -7,8 +7,6 @@
<list default="true" id="19c8c37d-a056-451c-a29d-fb612b9a3e2f" name="Default Changelist" comment="commit">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/CaptchaRelate/CaptchaController/CaptchaController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/CaptchaRelate/CaptchaController/CaptchaController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

@ -8,6 +8,7 @@ import (
"gitee.com/aesoper/captchaStore"
"github.com/gin-gonic/gin"
"github.com/mojocn/base64Captcha"
"image/color"
"net/http"
"time"
)
@ -56,13 +57,32 @@ var store *captchaStore.CustomCaptchaStore
// CaptMake 生成验证码
func CaptMake() (string, string) {
// 生成默认数字
driver := &base64Captcha.DriverDigit{
Height: 100,
Width: 200,
Length: 4,
MaxSkew: 1,
DotCount: 2,
//driver := &base64Captcha.DriverDigit{
// Height: 100,
// Width: 200,
// Length: 4,
// MaxSkew: 1,
// DotCount: 2,
//}
//https://captcha.mojotv.cn/
//四则运算
driver := &base64Captcha.DriverMath{
Height: 60,
Width: 240,
NoiseCount: 0,
BgColor: &color.RGBA{
R: 52,
G: 56,
B: 98,
A: 58,
},
Fonts: []string{"wqy-microhei.ttc"},
}
driver.ConvertFonts()
//中文
// 生成base64图片
c, err := cache.New(cache.Cfg{
Driver: "redis",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,7 @@
go get -u github.com/jteeuwen/go-bindata/...
go-bindata fonts
sed -i "s/package main/package base64Captcha/g" bindata.go
https://github.com/jteeuwen/go-bindata

Binary file not shown.
Loading…
Cancel
Save