middlewares

package
v0.0.0-...-ce5419d Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JWTMiddleWare

func JWTMiddleWare() gin.HandlerFunc

JWTMiddleWare 直接拦截token 解析出userId JWTMiddleWare 鉴权中间件,鉴权并设置user_id

func ReleaseToken

func ReleaseToken(user models.UserLogin) (string, error)

ReleaseToken 颁发token

func SHA1

func SHA1(s string) string

SHA1 sha1对字符串加密

func SHAMiddleWare

func SHAMiddleWare() gin.HandlerFunc

SHAMiddleWare 对密码进行加密

Types

type Claims

type Claims struct {
	UserId int64
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*Claims, bool)

ParseToken 解析token 返回Claims

Jump to

Keyboard shortcuts

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