Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorMessage_ValidationErrorMalformed = "无效token" ErrorMessage_ValidationErrorExpired = "token已过期" ErrorMessage_ValidationErrorNotValidYet = "token未激活" )
Variables ¶
View Source
var (
//KeyTokenClaim token写入gin.context的名称
KeyTokenClaim = "token-claims"
)
Functions ¶
func EncryToken ¶
func EncryToken(user TokenUserInput, secretKey string) (r string, err error)
EncryToken 创建jwt-token
func Middleware ¶
func Middleware(tokenName string, secretKey string) gin.HandlerFunc
Middleware token校验中间件
Types ¶
Click to show internal directories.
Click to hide internal directories.