Documentation ¶
Index ¶
- func Bind(c *gin.Context, req any) error
- func CORS() gin.HandlerFunc
- func GenTokens(user_id, user_name, user_avatar, server_number, email string, ...) ([2]string, [2]error)
- func GetKeys() [2][]uint8
- func JWTAuthMiddleware() func(c *gin.Context)
- func JWTAuthMiddlewareOrRefreshToken() func(c *gin.Context)
- func RefreshTokens(refreshTokens [2]string, timeout int) ([2]string, string, [2]error)
- type JwtClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS() gin.HandlerFunc
func JWTAuthMiddleware ¶
Types ¶
type JwtClaims ¶
type JwtClaims struct { UserId string `json:"user_id"` Username string `json:"user_name"` UserRole int `json:"user_role"` // 1<<1 黄小姐 1<<2 奇乐 1<<30 系统 UserAvatar string `json:"user_avatar"` ServerNumber string `json:"server_number"` Email string `josn:"email"` jwt.RegisteredClaims }
func GenJwtClaims ¶
Click to show internal directories.
Click to hide internal directories.