utils

package
v0.0.0-...-14e64f7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log logger

Log 日志记录器

View Source
var LogFile *os.File

LogFile 日志文件

Functions

func MD5Pwd

func MD5Pwd(username string, password string) string

MD5Pwd 密码哈希函数

func MakeToken

func MakeToken(authID string, authName string, authType string) (string, error)

MakeToken 创建JWT的TOKEN

Types

type MyClaims

type MyClaims struct {
	AuthID   string `json:"authID"`   // 用户ID
	AuthName string `json:"authName"` // 用户名
	AuthType string `json:"authType"` // 用户类型
	jwt.StandardClaims
}

MyClaims JWT加密的结构体

func ParseToken

func ParseToken(tokenString string) (*MyClaims, error)

ParseToken 解析JWT的TOKEN

Jump to

Keyboard shortcuts

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