token

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticator

func Authenticator(c *gin.Context) (interface{}, error)

Authenticator 认证器:login接口会经过这段逻辑

func Authorizator

func Authorizator(data interface{}, c *gin.Context) bool

func NewJwtMiddleware

func NewJwtMiddleware() (*jwt.GinJWTMiddleware, error)

NewJwtMiddleware returns a new JWT middleware. sample: https://github.com/appleboy/gin-jwt/blob/master/_example/basic/server.go

Types

type User

type User struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

User 定义 User 结构体,用于接受登录的用户名与密码 //jwt中payload的数据结构

Jump to

Keyboard shortcuts

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