Documentation ¶
Index ¶
Constants ¶
View Source
const (
VERPROFIX = "jwt_" // version前缀
)
Variables ¶
View Source
var ( JWTSECRET = "7KCQC8YW3AMF7A98OIUV2Q6MEKE3GTGSYB3RFWI89KS071URZ2MJDPZKTJIUVZUY" TokenTerm = time.Hour * 24 VersionCtl = false // 开启版本控制 )
todo 配置
View Source
var JWT_STATUS = map[int]string{
200: "OK",
400: "Token is required",
401: "Token verification failed",
504: "Token verification timeout",
}
Functions ¶
func Auth ¶
func Auth() gin.HandlerFunc
验证JWT的中间件 从Http头部的Authorization(忽略大小写)中获取Token信息,并验证Token的有效性。
Types ¶
Click to show internal directories.
Click to hide internal directories.