fix(power fields)

This commit is contained in:
zhengxinonly
2022-03-04 15:25:02 +08:00
parent c0d963628b
commit 9dcc05deda
+11 -1
View File
@@ -145,7 +145,17 @@ class RolePowerResource(Resource):
# 获取权限列表的 id
check_powers_list = [rp.id for rp in role.power]
powers = RightModels.query.all() # 获取所有的权限
powers = marshal(powers, RightModels.fields())
powers = [{
'powerId': item.id,
'powerName': item.name,
'powerType': item.type,
'powerUrl': item.url,
'openType': item.open_type,
'parentId': item.parent_id,
'icon': item.icon,
'sort': item.sort,
'enable': item.enable,
} for item in powers]
for i in powers:
if int(i.get("powerId")) in check_powers_list:
i["checkArr"] = "1"