mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
fix(system): 纠正Redis CURD批量获取方法参数传递问题
- 修正了RedisCURD.mget调用时传递keys参数的方式,去除多余的展开运算符 - 删除了无用的UpdateSystemParamsSchema定义,简化参数模型代码 - 更新系统初始化配置获取逻辑,统一修正mget的keys传递方式 - 调整系统初始化配置json数据,完善帮助文档、隐私政策、用户协议等字段 - 修改开发环境数据库配置,切换为PostgreSQL并更新相应端口及用户信息 - 删除冗余MySQL数据库备份脚本,避免版本管理中的重复和混乱
This commit is contained in:
@@ -21,7 +21,7 @@ class OnlineService:
|
||||
"""
|
||||
|
||||
keys = await RedisCURD(redis).get_keys(f"{RedisInitKeyConfig.ACCESS_TOKEN.key}:*")
|
||||
tokens = await RedisCURD(redis).mget(*keys)
|
||||
tokens = await RedisCURD(redis).mget(keys)
|
||||
|
||||
online_users = []
|
||||
for token in tokens:
|
||||
|
||||
@@ -24,18 +24,3 @@ class ParamsUpdateSchema(ParamsCreateSchema):
|
||||
class ParamsOutSchema(ParamsCreateSchema, BaseSchema):
|
||||
"""配置响应模型"""
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class UpdateSystemParamsSchema(BaseModel):
|
||||
"""更新系统配置"""
|
||||
sys_web_title: str = Field(description="网站标题")
|
||||
sys_web_description: str = Field(description="网站描述")
|
||||
sys_web_favicon: str = Field(description="网站图标")
|
||||
sys_web_logo: str = Field(description="网站logo")
|
||||
sys_login_background: str = Field(description="登录背景")
|
||||
sys_web_copyright: str = Field(description="版权信息")
|
||||
sys_keep_record: str = Field(description="备案号")
|
||||
sys_help_doc: str = Field(description="帮助文档")
|
||||
sys_web_privacy: str = Field(description="隐私条款")
|
||||
sys_web_clause: str = Field(description="用户协议")
|
||||
sys_git_code: str = Field(description="源码地址")
|
||||
@@ -17,7 +17,7 @@ from app.core.exceptions import CustomException
|
||||
from app.core.logger import logger
|
||||
from ..auth.schema import AuthSchema
|
||||
from .param import ParamsQueryParam
|
||||
from .schema import ParamsOutSchema, ParamsUpdateSchema, ParamsCreateSchema, UpdateSystemParamsSchema
|
||||
from .schema import ParamsOutSchema, ParamsUpdateSchema, ParamsCreateSchema
|
||||
from .crud import ParamsCRUD
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ class ParamsService:
|
||||
async def get_init_config_service(cls, redis: Redis) -> List[Dict]:
|
||||
"""获取系统配置"""
|
||||
redis_keys = await RedisCURD(redis).get_keys(f"{RedisInitKeyConfig.SYSTEM_CONFIG.key}:*")
|
||||
redis_configs = await RedisCURD(redis).mget(*redis_keys)
|
||||
redis_configs = await RedisCURD(redis).mget(redis_keys)
|
||||
configs = []
|
||||
for config in redis_configs:
|
||||
if not config:
|
||||
|
||||
Reference in New Issue
Block a user