diff --git a/src/easy_tdx/web/deps.py b/src/easy_tdx/web/deps.py index 877c8ca..f5c0881 100644 --- a/src/easy_tdx/web/deps.py +++ b/src/easy_tdx/web/deps.py @@ -2,15 +2,12 @@ from __future__ import annotations -import typing -from typing import TYPE_CHECKING - from fastapi import Request -if TYPE_CHECKING: - from easy_tdx.client import AsyncTdxClient +from easy_tdx.client import AsyncTdxClient def get_client(request: Request) -> AsyncTdxClient: """从 app.state 获取共享的 AsyncTdxClient 实例。""" - return typing.cast(AsyncTdxClient, request.app.state.tdx_client) + client: AsyncTdxClient = request.app.state.tdx_client + return client