auth

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JWTSign added in v0.0.4

func JWTSign(userInfo *UserInfo) (string, error)

JWTSign jwt签名

Types

type UserInfo

type UserInfo struct {
	ID       uint   `json:"id"`       // ID
	Username string `json:"username"` // 用户名
	Nickname string `json:"nickname"` // 昵称
	Avatar   string `json:"avatar"`   // 头像
}

UserInfo 用户信息

func GetUserInfo added in v0.0.4

func GetUserInfo(c *gin.Context) (*UserInfo, error)

GetUserInfo 获取用户信息

func JWTVerify added in v0.0.4

func JWTVerify(jwtToken string) (*UserInfo, error)

JWTVerify jwt验证

func TokenVerify added in v0.0.4

func TokenVerify(tokenStr string) (*UserInfo, error)

TokenVerify token验证

Jump to

Keyboard shortcuts

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