From b0ed2100a2553a948a2fd94a91d57260cad6bf63 Mon Sep 17 00:00:00 2001 From: VincentFu Date: Tue, 5 Oct 2021 05:53:05 +0000 Subject: [PATCH] =?UTF-8?q?update=20applications/view/admin/dict.py.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/view/admin/dict.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/applications/view/admin/dict.py b/applications/view/admin/dict.py index 7876ac7..33bc614 100644 --- a/applications/view/admin/dict.py +++ b/applications/view/admin/dict.py @@ -72,7 +72,18 @@ def dict_type_edit(): @authorize("admin:dict:edit", log=True) def dict_type_update(): req_json = request.json - dict_curd.update_dict_type(req_json) + id = xss_escape(req_json.get("id")) + description = xss_escape(req_json.get("description")) + enable = xss_escape(req_json.get("enable")) + type_code = xss_escape(req_json.get("typeCode")) + type_name = xss_escape(req_json.get("typeName")) + DictType.query.filter_by(id=id).update({ + "description": description, + "enable": enable, + "type_code": type_code, + "type_name": type_name + }) + db.session.commit() return success_api(msg="更新成功") -- Gitee