fix(issues):修改bug

This commit is contained in:
zhengxinonly
2021-07-28 00:08:47 +08:00
parent 460984f209
commit 0640255519
3 changed files with 47 additions and 72 deletions
+3 -5
View File
@@ -110,6 +110,7 @@ def make_menu_tree():
if _dict['id'] in menu_dict:
# 当前节点添加子节点
_dict['children'] = copy.deepcopy(menu_dict[_dict['id']])
_dict['children'].sort(key=lambda item: item['sort'])
# 删除子节点
del menu_dict[_dict['id']]
@@ -160,9 +161,6 @@ class RightRights(Resource):
def get(self):
"""获取选择父节点"""
# power = Power.query.all()
# res = marshal(power, power_fields)
power = Power.query.all()
power_data = marshal(power, power_fields)
power_data.append({"powerId": 0, "powerName": "顶级权限", "parentId": -1})
@@ -247,12 +245,12 @@ class RightsPower(Resource):
return success_api(msg="更新权限成功")
@rights_api.resource('power/<int:right_id>/status')
@rights_api.resource('/power/<int:right_id>/status')
class PowerStatus(Resource):
@authorize("admin:power:edit", log=True)
def put(self, right_id):
power = Power.query.get(id=right_id)
power = Power.query.get(right_id)
if power:
power.enable = not power.enable
db.session.commit()