code

package
v0.0.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//验证码
	EmailCodeGetParamsInvalidMsg    string = "获取验证码:提交的验证码参数无效,请检查验证码ID以及文件名后缀是否完整"
	EmailCodeGetParamsInvalidCode   int    = -400350
	EmailCodeCheckParamsInvalidMsg  string = "" /* 127-byte string literal not displayed */
	EmailCodeCheckParamsInvalidCode int    = -400351
	EmailCodeCheckOkMsg             string = "验证码校验通过"
	EmailCodeCheckFailCode          int    = -400355
	EmailCodeCheckFailMsg           string = "验证码校验失败"
)

Variables

This section is empty.

Functions

func Init

func Init()

Types

type EmailCodeController

type EmailCodeController struct {
	controller.ResourceController
	EmailCodeValidator *EmailCodeValidator `inject:"emailCodeValidator"`
}

func (*EmailCodeController) CheckCode

func (e *EmailCodeController) CheckCode(c *gin.Context)

func (*EmailCodeController) GenerateCode

func (e *EmailCodeController) GenerateCode(c *gin.Context)

func (*EmailCodeController) InitRouter

func (e *EmailCodeController) InitRouter(g *gin.RouterGroup) *gin.RouterGroup

*

  • 处理WEB验证码的API路由

type EmailCodeSender

type EmailCodeSender struct {
	EmailSender email.EmailSender `inject:"emailSender"`
}

func (*EmailCodeSender) SendVerificationCode

func (s *EmailCodeSender) SendVerificationCode(dest string, scene string, code string) error

type EmailCodeValidator

type EmailCodeValidator struct {
	code.Validator
	Sender code.CodeSender `inject:"emailCodeSender"`
	Store  code.CodeStore  `inject:"emailCodeStore"`
}

func (*EmailCodeValidator) GetSender

func (v *EmailCodeValidator) GetSender() code.CodeSender

func (*EmailCodeValidator) GetStore

func (v *EmailCodeValidator) GetStore() code.CodeStore

func (*EmailCodeValidator) HandleSmsCodeVerify

func (v *EmailCodeValidator) HandleSmsCodeVerify(force bool) gin.HandlerFunc

type EmailForm

type EmailForm struct {
	Email string `form:"phone"`
	Code  string `form:"code"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL