Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func IsAdminAuth ¶
func IsAdminAuth() gin.HandlerFunc
func JWTAuth ¶
func JWTAuth() gin.HandlerFunc
Types ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims models.CustomClaims) (string, error)
创建一个token
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*models.CustomClaims, error)
解析 token
Click to show internal directories.
Click to hide internal directories.