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)