From 537958e8badc7459cca2a38a1c49b7422f64bde1 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Mon, 21 Jul 2025 21:29:28 +0800 Subject: [PATCH] Update the default cache period for userinfo --- backend/common/security/jwt.py | 2 +- backend/core/conf.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/common/security/jwt.py b/backend/common/security/jwt.py index 29545587..296f0910 100644 --- a/backend/common/security/jwt.py +++ b/backend/common/security/jwt.py @@ -294,7 +294,7 @@ async def jwt_authentication(token: str) -> GetUserInfoWithRelationDetail: user = GetUserInfoWithRelationDetail(**select_as_dict(current_user)) await redis_client.setex( f'{settings.JWT_USER_REDIS_PREFIX}:{user_id}', - settings.JWT_USER_REDIS_EXPIRE_SECONDS, + settings.TOKEN_EXPIRE_SECONDS, user.model_dump_json(), ) else: diff --git a/backend/core/conf.py b/backend/core/conf.py index 390d14f4..10a3fbbe 100644 --- a/backend/core/conf.py +++ b/backend/core/conf.py @@ -75,7 +75,6 @@ class Settings(BaseSettings): # JWT JWT_USER_REDIS_PREFIX: str = 'fba:user' - JWT_USER_REDIS_EXPIRE_SECONDS: int = 60 * 60 * 24 * 7 # 7 天 # RBAC RBAC_ROLE_MENU_MODE: bool = True