From e4627e6ba3d0be6b6e469f3ed57410d574b3c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B8=85?= Date: Wed, 2 Sep 2026 15:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=89=B9=E6=AC=A1=E8=BD=AE=E6=AC=A1?= =?UTF-8?q?=E5=92=8C=E9=97=AE=E9=A2=98=E7=AD=9B=E9=80=89=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- ocr_dashboard_service.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index c6e6987..e079179 100644 --- a/app.py +++ b/app.py @@ -433,7 +433,7 @@ def create_app() -> Flask: @app.route("/api/v1/data-dashboard/ocr/configured-notes", methods=["GET"]) def query_ocr_configured_notes(): - return jsonify({"data": list_ocr_configured_notes(), "request_id": g.request_id}) + return jsonify({"data": list_ocr_configured_notes(request.args.to_dict()), "request_id": g.request_id}) @app.route("/api/v1/data-dashboard/ocr/evidences/export", methods=["GET"]) def export_ocr_dashboard_evidences(): diff --git a/ocr_dashboard_service.py b/ocr_dashboard_service.py index 991f9e0..e9f8b28 100644 --- a/ocr_dashboard_service.py +++ b/ocr_dashboard_service.py @@ -201,13 +201,15 @@ def list_evidences(params: dict[str, Any]) -> dict[str, Any]: return data -def list_configured_notes() -> list[dict[str, Any]]: +def list_configured_notes(params: dict[str, Any] | None = None) -> list[dict[str, Any]]: """读取凭证后台中由用户配置的多篇展示笔记。""" if not Config.EVIDENCE_ADMIN_BASE_URL: return [] try: response = SESSION.get( f"{Config.EVIDENCE_ADMIN_BASE_URL}/api/notes", + params={key: value for key, value in (params or {}).items() + if key in {"batch_key", "collection_key", "question_code"} and value}, timeout=min(Config.CRAWLER_TIMEOUT_SECONDS, 15), ) response.raise_for_status()