!134 【轻量级 PR】:update applications/view/system/rights.py.

Merge pull request !134 from 星辰大海/N/A
This commit is contained in:
我叫以赏
2025-02-25 11:28:31 +00:00
committed by Gitee
+1 -1
View File
@@ -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)