From d49b3c1a7949db52e0cdbeffb7b00795c0e974b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E8=BE=B0=E5=A4=A7=E6=B5=B7?= <2317903+shaodj@user.noreply.gitee.com> Date: Tue, 25 Feb 2025 11:27:47 +0000 Subject: [PATCH] =?UTF-8?q?update=20applications/view/system/rights.py.=20?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E4=B9=9F=E9=9C=80=E8=A6=81=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA=E7=9A=84=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 星辰大海 <2317903+shaodj@user.noreply.gitee.com> --- applications/view/system/rights.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/view/system/rights.py b/applications/view/system/rights.py index 2087da4..9ea5df4 100644 --- a/applications/view/system/rights.py +++ b/applications/view/system/rights.py @@ -237,7 +237,7 @@ def menu(): menu_dict[_dict['parent_id']].append(_dict) return jsonify(sorted(menu_dict.get(0), key=lambda item: item['sort'])) else: - powers = Power.query.all() + powers = Power.query.filter(Power.enable == 1).all() power_schema = PowerOutSchema(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类 power_dict = power_schema.dump(powers) # 生成可序列化对象 power_dict.sort(key=lambda x: (x['parent_id'], x['id']), reverse=True) -- Gitee