Documentation ¶
Index ¶
Constants ¶
View Source
const ( //验证码 SmsCodeGetParamsInvalidMsg string = "获取验证码:提交的验证码参数无效,请检查验证码ID以及文件名后缀是否完整" SmsCodeGetParamsInvalidCode int = -400350 SmsCodeCheckParamsInvalidMsg string = "" /* 127-byte string literal not displayed */ SmsCodeCheckParamsInvalidCode int = -400351 SmsCodeCheckOkMsg string = "验证码校验通过" SmsCodeCheckFailCode int = -400355 SmsCodeCheckFailMsg string = "验证码校验失败" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SmsCodeController ¶
type SmsCodeController struct { controller.ResourceController SmsCodeValidator *SmsCodeValidator `inject:"smsCodeValidator"` }
*
- Controller
func (*SmsCodeController) CheckCode ¶
func (s *SmsCodeController) CheckCode(c *gin.Context)
func (*SmsCodeController) GenerateCode ¶
func (s *SmsCodeController) GenerateCode(c *gin.Context)
func (*SmsCodeController) InitRouter ¶
func (s *SmsCodeController) InitRouter(g *gin.RouterGroup) *gin.RouterGroup
*
- 处理WEB验证码的API路由
type SmsCodeSender ¶
func (*SmsCodeSender) SendVerificationCode ¶
func (s *SmsCodeSender) SendVerificationCode(dest string, scene string, code string) error
type SmsCodeValidator ¶
type SmsCodeValidator struct { code.Validator Sender code.CodeSender `inject:"smsCodeSender"` Store code.CodeStore `inject:"smsCodeStore"` }
*
- Validator
func (*SmsCodeValidator) GetSender ¶
func (v *SmsCodeValidator) GetSender() code.CodeSender
func (*SmsCodeValidator) GetStore ¶
func (v *SmsCodeValidator) GetStore() code.CodeStore
func (*SmsCodeValidator) HandleSmsCodeVerify ¶
func (v *SmsCodeValidator) HandleSmsCodeVerify(force bool) gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.