middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearToken

func ClearToken(token string)

ClearToken 请除Token

func Cors

func Cors() gin.HandlerFunc

Cors 处理跨域请求,支持options访问

func Error

func Error() gin.HandlerFunc

func Format

func Format() gin.HandlerFunc

func GenerateToken

func GenerateToken(info TokenInfo) (string, error)

func HttpNeedToUseGetRequest

func HttpNeedToUseGetRequest(c *gin.Context) interface{}

func HttpNeedToUsePostRequest

func HttpNeedToUsePostRequest(c *gin.Context) interface{}

func Login

func Login() gin.HandlerFunc

func Site

func Site() gin.HandlerFunc

func Token

func Token() gin.HandlerFunc

Token 通过Token换成UID

Types

type TokenInfo

type TokenInfo struct {
	Uid        int64
	Username   string
	Nickname   string
	Expiration time.Duration
}

func ParseToken

func ParseToken(token string) (*TokenInfo, *exception.Error)

Jump to

Keyboard shortcuts

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