jwt

package
v0.0.0-...-9337120 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

JSON WEB TOKEN 层

Index

Constants

View Source
const (
	ERROR_AUTH_TOKEN = 40006
)

内置异常

Variables

View Source
var TOKEN_ERROR = map[int]string{
	ERROR_AUTH_TOKEN: "Token生成失败",
}

Functions

func GenerateToken

func GenerateToken(gmUser model.GmUserModel) (string, error)

生成token

Types

type Claims

type Claims struct {
	UserID   int32  `json:"id"`
	Username string `json:"username"`
	RealName string `json:"real_name"`
	RoleId   int32  `json:"role_id"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

解析token

Jump to

Keyboard shortcuts

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