token

package
v0.0.0-...-7c9259c Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtPayload

type JwtPayload struct {
	UserID uint `json:"user_id"`
	jwt.RegisteredClaims
}

JwtPayload JWT Token 附带的数据

func GenToken

func GenToken(uid uint, secretKey string, d time.Duration) (string, *JwtPayload, error)

GenToken 生成 JWT Token

func ParseToken

func ParseToken(tokenStr string, secretKey string) (*JwtPayload, error)

ParseToken 验证、解析 JWT Token

Jump to

Keyboard shortcuts

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