middleware

package
v0.0.0-...-c2dc3ab Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtKey = []byte(utils.JwtKey)

Functions

func Cors

func Cors() gin.HandlerFunc

func JwtToken

func JwtToken() gin.HandlerFunc

jwt中间件

func Logger

func Logger() gin.HandlerFunc

func SetToken

func SetToken(username string) (string, int)

生成token

Types

type MyCliams

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

func CheckToken

func CheckToken(token string) (*MyCliams, int)

验证token

Jump to

Keyboard shortcuts

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