middleware

package
v0.0.0-...-18a26fb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const IdentityKey = "UserDetail"

Variables

This section is empty.

Functions

func CheckAuthMiddlewareFunc

func CheckAuthMiddlewareFunc(auth user2.Auth) gin.HandlerFunc

func ClearCheckAuth

func ClearCheckAuth()

func Code

func Code() *code

func GetAuthUser

func GetAuthUser(ctx *gin.Context) (user2.User, error)

func InitCheckAuth

func InitCheckAuth(svc *svc.Svc)

func InitJWT

func InitJWT(svc *svc.Svc) *jwt.GinJWTMiddleware

func JWT

func JWT() *jwt.GinJWTMiddleware

Types

type CheckAuth

type CheckAuth struct {
	// contains filtered or unexported fields
}

type CodeResp

type CodeResp struct {
	Id    string    `json:"id"`
	Image string    `json:"image"`
	Ext   time.Time `json:"ext"`
}

type JwtMapClaims

type JwtMapClaims struct {
	Id           uint       `json:"id"`
	Auth         user2.Auth `json:"auth"`
	Name         string     `json:"name"`
	EnName       string     `json:"enName"`
	LoginID      string     `json:"loginID"`
	CubeID       string     `json:"cubeID"`
	WcaID        string     `json:"wcaID"`
	DelegateName string     `json:"delegateName"`
}

func GetJwtUser

func GetJwtUser(ctx *gin.Context) (JwtMapClaims, error)

type LoginRequest

type LoginRequest struct {
	// 登录信息
	LoginID   string `json:"loginID"`  // 登录用的ID, email, phone, QQ等,
	Password  string `json:"password"` // 密码(加密后)
	TimeStamp int64  `json:"timestamp"`
	// 验证码
	VerifyId    string `json:"verifyId"`
	VerifyValue string `json:"verifyValue"`
}

Jump to

Keyboard shortcuts

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