|
|
@ -67,22 +67,38 @@ func CaptMake() (string, string) {
|
|
|
|
//https://captcha.mojotv.cn/
|
|
|
|
//https://captcha.mojotv.cn/
|
|
|
|
|
|
|
|
|
|
|
|
//四则运算
|
|
|
|
//四则运算
|
|
|
|
driver := &base64Captcha.DriverMath{
|
|
|
|
//driver := &base64Captcha.DriverMath{
|
|
|
|
Height: 60,
|
|
|
|
// Height: 60,
|
|
|
|
Width: 240,
|
|
|
|
// Width: 240,
|
|
|
|
NoiseCount: 0,
|
|
|
|
// NoiseCount: 0,
|
|
|
|
|
|
|
|
// BgColor: &color.RGBA{
|
|
|
|
|
|
|
|
// R: 52,
|
|
|
|
|
|
|
|
// G: 56,
|
|
|
|
|
|
|
|
// B: 98,
|
|
|
|
|
|
|
|
// A: 58,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// Fonts: []string{"wqy-microhei.ttc"},
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//driver.ConvertFonts()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//中文
|
|
|
|
|
|
|
|
driver := &base64Captcha.DriverChinese{
|
|
|
|
|
|
|
|
Height: 50,
|
|
|
|
|
|
|
|
Width: 300,
|
|
|
|
|
|
|
|
NoiseCount: 0,
|
|
|
|
|
|
|
|
ShowLineOptions: 1,
|
|
|
|
|
|
|
|
Length: 2,
|
|
|
|
BgColor: &color.RGBA{
|
|
|
|
BgColor: &color.RGBA{
|
|
|
|
R: 52,
|
|
|
|
R: 52,
|
|
|
|
G: 56,
|
|
|
|
G: 56,
|
|
|
|
B: 98,
|
|
|
|
B: 98,
|
|
|
|
A: 58,
|
|
|
|
A: 58,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Fonts: []string{"wqy-microhei.ttc"},
|
|
|
|
Source: "东师理想,大数据,超融合,智慧校园,数字校园,黄海,吴缤,超人气,抗疫情,努力,加油,长春",
|
|
|
|
|
|
|
|
Fonts: []string{"wqy-microhei.ttc"},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
driver.ConvertFonts()
|
|
|
|
driver.ConvertFonts()
|
|
|
|
|
|
|
|
|
|
|
|
//中文
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 生成base64图片
|
|
|
|
// 生成base64图片
|
|
|
|
c, err := cache.New(cache.Cfg{
|
|
|
|
c, err := cache.New(cache.Cfg{
|
|
|
|
Driver: "redis",
|
|
|
|
Driver: "redis",
|
|
|
|