_jwt

package
v0.0.0-...-8412fec Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(userId int64, name, avatar, email string, clientType int) string

GenerateToken 生成token

func RefreshToken

func RefreshToken(tokenString string) (string, error)

RefreshToken 刷新token

Types

type UserClaims

type UserClaims struct {
	ID         int64  `json:"user_id"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
	Email      string `json:"email" validate:"required,email"`
	ClientType int    `json:"client_type"` // 用户登陆设备 1.web 2.pc 3.app 目前只支持web
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*UserClaims, error)

ParseToken 解析token

Jump to

Keyboard shortcuts

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