🎨
This commit is contained in:
@@ -63,6 +63,10 @@ func Authorization() gin.HandlerFunc {
|
||||
// 将用户信息放入上下文
|
||||
c.Set("user", &user)
|
||||
|
||||
if c.Request.RequestURI == "/api/user/logout" {
|
||||
c.Next()
|
||||
}
|
||||
|
||||
// 生成一个新token
|
||||
secret := component.JWT().GenerateSecret(user.Password, uuid.NewString(), time.Now().Local().String())
|
||||
tokenStr, _, err := component.JWT().GenerateToken(user.Id, secret, userClaims.ExpiresAt.Time, time.Now().Local())
|
||||
|
Reference in New Issue
Block a user