update applications/view/system/rights.py.
管理员也需要隐藏不要显示的菜单。 Signed-off-by: 星辰大海 <2317903+shaodj@user.noreply.gitee.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user