Documentation ¶
Index ¶
- func CreateJwtToken(c *gin.Context, ID bson.ObjectId, UserName string)
- func ErrorHandler() gin.HandlerFunc
- func ParseJwtToken(tokenString string) (bson.ObjectId, string, bool)
- func RefreshToken(c *gin.Context)
- func SetCookie(c *gin.Context, name string, value string)
- func SigninRequired(c *gin.Context)
- type CustomClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJwtToken ¶
创建jwttoken
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
Types ¶
type CustomClaims ¶
type CustomClaims struct { UserName string `json:"username"` ID bson.ObjectId `json:"id" bson:"_id"` jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.