Files
atom/providers/config/section_captcha.go
2023-02-04 16:24:08 +08:00

23 lines
632 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package config
import (
"log"
"time"
)
type Captcha struct {
KeyLong uint // 验证码长度
ImgWidth uint // 验证码宽度
ImgHeight uint // 验证码高度
OpenCaptcha uint // 防爆破验证码开启此数0代表每次登录都需要验证码其他数字代表错误密码此数如3代表错误三次后出现验证码
OpenCaptchaTimeOut string // 防爆破验证码超时时间单位s(秒)
}
func (c *Captcha) OpenCaptchaTimeOutDuration() time.Duration {
d, err := time.ParseDuration(c.OpenCaptchaTimeOut)
if err != nil {
log.Panic(err)
}
return d
}