VCodeImageCore

package
v5.1.37 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(args *ArgsCheck) bool

Check 验证验证码

func Clear

func Clear() (err error)

清除所有验证码 将清除所有验证码,该方法可用于系统维护等操作 注意,该操作将直接操作原始数据,不是普通的delete删除操作

func Generate

func Generate(args *ArgsGenerate) (imgData base64Captcha.CaptchaInterface, err error)

Generate 生成验证码

func Init

func Init() (err error)

Init 初始化

func Run

func Run()

Run 自动维护工具

Types

type ArgsCheck

type ArgsCheck struct {
	//会话
	Token int64
	//验证的值
	Value string
}

ArgsCheck 验证验证码参数

type ArgsGenerate

type ArgsGenerate struct {
	//会话
	Token int64 `db:"token"`
}

ArgsGenerate 生成验证码参数

type FieldsVCodeType

type FieldsVCodeType struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	// 根据该时间判定过期,因为配置过期时间可能发生变更
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//token会话
	Token int64 `db:"token" json:"token"`
	//验证码
	Value string `db:"value" json:"value"`
}

验证码机制

Jump to

Keyboard shortcuts

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