菜单管理树构建改用后端构建

This commit is contained in:
不做码农
2022-01-15 21:31:40 +08:00
parent 68686f60fc
commit 512c5bc176
9 changed files with 132 additions and 57 deletions

View File

@@ -2,6 +2,7 @@
using Infrastructure.Model;
using SqlSugar;
using System.Collections.Generic;
using System.Linq;
using ZR.Model;
using ZR.Model.System;
@@ -110,6 +111,16 @@ namespace ZR.Repository.System
return Context.Queryable<SysRoleMenu>().Where(it => it.Role_id == roleId).ToList();
}
/// <summary>
/// 根据用户所有角色获取菜单
/// </summary>
/// <param name="roleIds"></param>
/// <returns></returns>
public List<SysRoleMenu> SelectRoleMenuByRoleIds(long[] roleIds)
{
return Context.Queryable<SysRoleMenu>().Where(it => roleIds.Contains(it.Role_id)).ToList();
}
/// <summary>
/// 批量插入用户菜单
/// </summary>