feat: 菜单树缺少根节点异常处理

This commit is contained in:
zy7y
2022-09-18 15:01:20 +08:00
parent 80947a608e
commit aefb93b399
8 changed files with 232 additions and 227 deletions

View File

@@ -49,18 +49,6 @@ async def del_menu(mid: int):
return await MenuModel.filter(id=mid).update(status=9)
async def get_has_api(pk: int, api: str, method: str):
"""获取角色接口权限 每次来查数据库"""
db = connections.get("default")
return await db.execute_query_dict(
"""
select m.api, m.method
FROM sys_menu as m, sys_role_menu as srm WHERE m.id = srm.mid
AND srm.rid = (?) and m.api = (?) and m.method = (?) and m.status != 9""",
[pk, api, method],
)
async def get_apis(pk: int):
"""返回当前角色拥有的接口权限列表"""
db = connections.get("default")