From aa80c1b00aab2825b9a96a100fc4c8208c35d39c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 15 Sep 2025 09:40:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20cdview=E4=BC=98=E5=8C=96=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/em/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/em/views.py b/apps/em/views.py index 9174e32b..b39a07af 100644 --- a/apps/em/views.py +++ b/apps/em/views.py @@ -180,7 +180,9 @@ class CdView(MyLoggingMixin, APIView): 执行采集数据方法 """ - method = request.data.get("method") + method = request.data.get("method", None) + if not method: + raise ParseError("请传入method参数") m = method.split("(")[0] args = method.split("(")[1].split(")")[0].split(",") module, func = m.rsplit(".", 1)