1 Star 0 Fork 0

Cruvie Kang / kk_go_kit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
captcha_config.go 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
Cruvie 提交于 2023-11-24 22:58 . rebuild
package kk_captcha
import (
"github.com/mojocn/base64Captcha"
"image/color"
)
// mathConfig 生成图形化算术验证码配置
func mathConfig() *base64Captcha.DriverMath {
mathType := &base64Captcha.DriverMath{
Height: 40,
Width: 100,
NoiseCount: 0,
ShowLineOptions: 0,
BgColor: &color.RGBA{
R: 255,
G: 255,
B: 255,
A: 0,
},
Fonts: nil,
}
return mathType
}
//
//// digitConfig 生成图形化数字验证码配置
//func digitConfig() *base64Captcha.DriverDigit {
// digitType := &base64Captcha.DriverDigit{
// Height: 50,
// Width: 100,
// Length: 5,
// MaxSkew: 0.45,
// DotCount: 80,
// }
// return digitType
//}
//
//// stringConfig 生成图形化字符串验证码配置
//func stringConfig() *base64Captcha.DriverString {
// stringType := &base64Captcha.DriverString{
// Height: 40,
// Width: 100,
// NoiseCount: 0,
// ShowLineOptions: 0,
// Length: 4,
// //去掉1ilL5s0oZz28B9gq6b0D不好识别的字符
// Source: "347wertyupadfhjkxcvnmQWERTYUPAFGHJKXCVNM",
// BgColor: &color.RGBA{
// R: 255,
// G: 255,
// B: 255,
// A: 1,
// },
// Fonts: nil,
// }
// return stringType
//}
//
//// chineseConfig 生成图形化汉字验证码配置
//func chineseConfig() *base64Captcha.DriverChinese {
// chineseType := &base64Captcha.DriverChinese{
// Height: 50,
// Width: 100,
// NoiseCount: 0,
// ShowLineOptions: base64Captcha.OptionShowSlimeLine,
// Length: 2,
// Source: "设想,你在,处理,消费者,的音,频输,出音,频可,能无,论什,么都,没有,任何,输出,或者,它可,能是,单声道,立体声,或是,环绕立,体声的,不想要,的值",
// BgColor: &color.RGBA{
// R: 40,
// G: 30,
// B: 89,
// A: 29,
// },
// Fonts: nil,
// }
// return chineseType
//}
//
//// autoConfig 生成图形化数字音频验证码配置
//func autoConfig() *base64Captcha.DriverAudio {
// chineseType := &base64Captcha.DriverAudio{
// Length: 4,
// Language: "zh",
// }
// return chineseType
//}
1
https://gitee.com/cruvie/kk_go_kit.git
git@gitee.com:cruvie/kk_go_kit.git
cruvie
kk_go_kit
kk_go_kit
8ab331d8547b

搜索帮助