tokens

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenShortToken

func GenShortToken() string

func GenToken

func GenToken(userID string, payloadData interface{}) (string, error)

GenToken 生成JWT

func GenToken2

func GenToken2(userID string, payloadData interface{}) (jwtToken string, shortToken string, err error)

GenToken2 带返回短token

Types

type UserClaims

type UserClaims struct {
	ShortToken string      `json:"short_token"`
	UserID     string      `json:"userId"`
	Data       interface{} `json:"data"`
	jwt.RegisteredClaims
}

func ParseToken

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

ParseToken 解析JWT

Jump to

Keyboard shortcuts

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