fix: 选表前先进入即席查询,登录没接上时说明原因

This commit is contained in:
2026-11-09 17:31:07 +08:00
parent 1b3f5cae36
commit fe5d06f8d9
2 changed files with 22 additions and 4 deletions
+6 -3
View File
@@ -477,9 +477,12 @@ def nqi_catalog(code: int | None = None, actor: Actor = Depends(current_actor),
try:
client.import_cookies(cookies)
await client.current_user()
if code is None:
return {"categories": await categories(client)}
return {"tables": await tables(client, code)}
try:
if code is None:
return {"categories": await categories(client)}
return {"tables": await tables(client, code)}
except NqiAuthError as exc:
raise NqiError("门户登录还在,但进入即席查询没有接上,请用这个大数据账号重新登录一次") from exc
finally:
await client.aclose()