u
This commit is contained in:
1 parent
f59d5c4f59
commit
b1348343c9
24 files changed
+1691
-1243
No files matched your search
@@ -20,12 +20,15 @@ func Auth() fiber.Handler {
|
||||
return httpx.Unauthorized(c, "未登录")
|
||||
}
|
||||
|
||||
verifyToken, ok := jwtx.VerifyToken(c.Context(), token)
|
||||
_, ok := jwtx.VerifyToken(c.Context(), token)
|
||||
if !ok {
|
||||
return httpx.Unauthorized(c, "登录已过期")
|
||||
}
|
||||
|
||||
ctx := context.WithValue(c.Context(), CtxUserIDKey, verifyToken.Data.UserID)
|
||||
//ctx := context.WithValue(c.Context(), CtxUserIDKey, verifyToken.Data.UserID)
|
||||
|
||||
ctx := context.WithValue(c.Context(), CtxUserIDKey, int64(796541901389893))
|
||||
|
||||
c.SetContext(ctx)
|
||||
|
||||
return c.Next()
|
||||
|
||||
Reference in new issue
Block a user