封装 redis 客户端处理方案

This commit is contained in:
zk
2026-04-10 10:34:41 +08:00
parent c001ba8146
commit 70a080d9b3
4 changed files with 49 additions and 44 deletions
+3 -3
View File
@@ -78,12 +78,12 @@ class JwtAuthMiddleware(BaseHTTPMiddleware):
if not user_id or not uu_id:
return
from app.core.redis import redis_client
if redis_client is None:
from app.core.redis import RedisManager
if RedisManager.client is None:
return
redis_key = f"client:login:token:{user_id}"
raw = await redis_client.get(redis_key)
raw = await RedisManager.client.get(redis_key)
if not raw:
return