This commit is contained in:
oneao committed 2026-04-21 17:29:49 +08:00
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()