midlleware

package
v0.0.0-...-17949e6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 14 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 JwtMid

func JwtMid() gin.HandlerFunc

JwtMid

func Logger

func Logger() gin.HandlerFunc

func SetToken

func SetToken(username string) (string, int)

生成Token

Types

type MyClaims

type MyClaims struct {
	UserName string `json:"username"`
	jwt.StandardClaims
}

func CheckToken

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

验证Token

Jump to

Keyboard shortcuts

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