auth

package
v0.0.0-...-dcbaf51 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(id int64) (string, error)

CreateToken 创建Token

Types

type Claims

type Claims struct {
	// ID 用户ID
	ID int64 `json:"id"`
	// jwt标准载荷
	jwt.RegisteredClaims
}

Claims 自定义载荷结构,包含了一个标准的JWT载荷

func ParseToken

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

ParseToken 解析token字符串

Jump to

Keyboard shortcuts

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