Example #1
0
        public async Task <TData <List <ZtreeInfo> > > QueryRoleAuthTree([FromQuery] long id)
        {
            var allMenu = await _menuBLL.GetZtreeList(null);

            var roleInfo = await _roleBLL.GetEntity(id);

            if (string.IsNullOrEmpty(roleInfo.Data.MenuIds))
            {
                return(allMenu);
            }

            foreach (var ztree in allMenu.Data)
            {
                foreach (var _Id in roleInfo.Data.MenuIds.Split(','))
                {
                    if (long.Parse(_Id) == ztree.id)
                    {
                        ztree.@checked = true;
                    }
                }
            }

            return(allMenu);
        }