jwt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MulanPSL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtKey = []byte("1dsasadsadasd")

Functions

func GetToken

func GetToken(username string) (string, ecode.BizErr)

SetToken 生成token

func JwtToken

func JwtToken() gin.HandlerFunc

JwtToken jwt中间件

Types

type JwtClaims

type JwtClaims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

func CheckToken

func CheckToken(token string) (*JwtClaims, ecode.BizErr)

CheckToken 验证token

Jump to

Keyboard shortcuts

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