middleware

package
v0.0.0-...-8da5f6f Latest Latest
Warning

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

Go to latest
Published: Jun 25, 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 JwtToken

func JwtToken() gin.HandlerFunc

JwtToken JWT中介層

func Logger

func Logger() gin.HandlerFunc

func SetToken

func SetToken(username string) (string, int)

SetToken 產生Token

Types

type MyClaims

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

func CheckToken

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

CheckToken 驗證Token

Jump to

Keyboard shortcuts

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