auth

package
v0.0.0-...-ca98365 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenKey  = "Authorization"
	CliamsKey = "CliamsKey"
)

Variables

This section is empty.

Functions

func AuthMiddlewares

func AuthMiddlewares() []gin.HandlerFunc

func GenerateJWT

func GenerateJWT(rBase RoleBase) (string, error)

Types

type Cliams

type Cliams struct {
	RoleBase
	jwt.StandardClaims
}

func ParseJWT

func ParseJWT(token string) (*Cliams, error)

type RoleBase

type RoleBase struct {
	Id       int    `json:"id"`
	UUID     string `json:"uuid"`
	Avatar   string `json:"avator"` // 头像
	Nickname string `json:"nickname"`
	Sex      int    `json:"sex"`
	Time     int64  `json:"time"`
	Ip       string `json:"ip"`
}

Jump to

Keyboard shortcuts

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