From 23e30fba17cef9bdb74357bff6db205f7f00c300 Mon Sep 17 00:00:00 2001 From: wuaho Date: Wed, 12 May 2021 14:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E7=BB=84=E5=B5=8C=E5=A5=97=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/verification.py | 2 ++ routers/point.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/verification.py b/common/verification.py index 1c72b53..4d80d14 100644 --- a/common/verification.py +++ b/common/verification.py @@ -16,6 +16,8 @@ def restore_field(data: dict) -> tuple: else: res[key] = v if isinstance(v, list): + if isinstance(v, dict) or isinstance(v, list): + raise ValueError(f'请检查字段:{key} 数据类型,值:{v}') sign_kv[key] = ','.join(map(lambda x: str(x), v)) else: sign_kv[key] = v diff --git a/routers/point.py b/routers/point.py index 7fec7b1..e898027 100644 --- a/routers/point.py +++ b/routers/point.py @@ -53,5 +53,6 @@ async def point(request: Request, items: DataModel): return {"code": 0, 'msg': 'ok'} except Exception as e: - msg = traceback.format_exc() - print(msg) + # msg = traceback.format_exc() + + return {"code": -1, 'msg': str(e)}