jwt

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	ID       int32  `json:"id"`
	Username string `json:"username"`
	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