fix(api): use async site query for mapping (#6416)

This commit is contained in:
InfinityPacer
2026-08-23 17:54:26 +08:00
committed by GitHub
parent e1d7918297
commit f7f5a7e107
2 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -580,14 +580,14 @@ def auth_site(
response_model=_SchemaResponse[_SchemaSiteMappingData],
)
async def site_mapping(
query: SiteQueryService = Depends(get_site_sync_query_service),
query: SiteQueryService = Depends(get_site_query_service),
_: ApiPrincipal = Depends(get_current_active_superuser_async),
):
"""
获取站点域名到名称的映射关系
"""
try:
sites = query.list_sync()
sites = await query.list_ordered()
mapping = {}
for site in sites:
mapping[site.domain] = site.name