Documentation ¶
Index ¶
Constants ¶
View Source
const ( //验证码 CaptchaGetParamsInvalidMsg string = "获取验证码:提交的验证码参数无效,请检查验证码ID以及文件名后缀是否完整" CaptchaGetParamsInvalidCode int = -400350 CaptchaCheckParamsInvalidMsg string = "" /* 127-byte string literal not displayed */ CaptchaCheckParamsInvalidCode int = -400351 CaptchaCheckOkMsg string = "验证码校验通过" CaptchaCheckOkCode int = 200 CaptchaCheckFailCode int = -400355 CaptchaCheckFailMsg string = "图形验证码校验失败" )
Variables ¶
This section is empty.
Functions ¶
func HandleCaptchaVerify ¶
func HandleCaptchaVerify(force bool) gin.HandlerFunc
Types ¶
type Base64CaptchaStoreAdapter ¶
type Base64CaptchaStoreAdapter struct { base64Captcha.Store CodeStore code.CodeStore }
func (*Base64CaptchaStoreAdapter) Get ¶
func (a *Base64CaptchaStoreAdapter) Get(id string, clear bool) string
Get returns stored digits for the captcha id. Clear indicates whether the captcha must be deleted from the store.
type CaptchaController ¶
type CaptchaController struct { controller.ResourceController CaptchaService *CaptchaService `inject:"captchaService"` }
func (*CaptchaController) CheckCode ¶
func (c *CaptchaController) CheckCode(context *gin.Context)
校验验证码
func (*CaptchaController) Generate ¶
func (c *CaptchaController) Generate(context *gin.Context)
生成验证码
func (*CaptchaController) InitRouter ¶
func (c *CaptchaController) InitRouter(g *gin.RouterGroup) *gin.RouterGroup
type CaptchaForm ¶
type CaptchaService ¶
type CaptchaService struct { Store code.CodeStore `inject:"captchaCodeStore"` // contains filtered or unexported fields }
func (*CaptchaService) Init ¶
func (s *CaptchaService) Init()
func (*CaptchaService) Verify ¶
func (s *CaptchaService) Verify(id, value string) bool
type CaptchaStoreAdpter ¶
func (*CaptchaStoreAdpter) Get ¶
func (a *CaptchaStoreAdpter) Get(id string, clear bool) (digits []byte)
Get returns stored digits for the captcha id. Clear indicates whether the captcha must be deleted from the store.
func (*CaptchaStoreAdpter) Set ¶
func (a *CaptchaStoreAdpter) Set(id string, digits []byte)
Set sets the digits for the captcha id.
Click to show internal directories.
Click to hide internal directories.