!134 【轻量级 PR】:update applications/view/system/rights.py.
Merge pull request !134 from 星辰大海/N/A
This commit is contained in:
@@ -237,7 +237,7 @@ def menu():
|
|||||||
menu_dict[_dict['parent_id']].append(_dict)
|
menu_dict[_dict['parent_id']].append(_dict)
|
||||||
return jsonify(sorted(menu_dict.get(0), key=lambda item: item['sort']))
|
return jsonify(sorted(menu_dict.get(0), key=lambda item: item['sort']))
|
||||||
else:
|
else:
|
||||||
powers = Power.query.all()
|
powers = Power.query.filter(Power.enable == 1).all()
|
||||||
power_schema = PowerOutSchema(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类
|
power_schema = PowerOutSchema(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类
|
||||||
power_dict = power_schema.dump(powers) # 生成可序列化对象
|
power_dict = power_schema.dump(powers) # 生成可序列化对象
|
||||||
power_dict.sort(key=lambda x: (x['parent_id'], x['id']), reverse=True)
|
power_dict.sort(key=lambda x: (x['parent_id'], x['id']), reverse=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user