From c71562a12f78fd9e0407e84174effbbd9a11769f Mon Sep 17 00:00:00 2001 From: VincentFu Date: Sun, 3 Oct 2021 17:31:39 +0000 Subject: [PATCH 1/2] =?UTF-8?q?update=20applications/view/department/=5F?= =?UTF-8?q?=5Finit=5F=5F.py.=20=E8=BF=99=E4=B8=AA=E5=9C=B0=E6=96=B9?= =?UTF-8?q?=E4=B9=9F=E9=9C=80=E8=A6=81=E7=9B=B8=E5=BA=94=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=92=8Cpower.py=E4=B8=80=E6=A0=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/view/department/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/view/department/__init__.py b/applications/view/department/__init__.py index 71e7b46..cd8e7af 100644 --- a/applications/view/department/__init__.py +++ b/applications/view/department/__init__.py @@ -22,7 +22,7 @@ def main(): return render_template('admin/dept/main.html') -@dept_bp.get('/data') +@dept_bp.post('/data') @authorize("admin:dept:main", log=True) def data(): dept = Dept.query.order_by(Dept.sort).all() From b0ed2100a2553a948a2fd94a91d57260cad6bf63 Mon Sep 17 00:00:00 2001 From: VincentFu Date: Tue, 5 Oct 2021 05:53:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?update=20applications/view/admin/dict.py.?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9B=B4=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="更新成功")