public JsonResult PrivilegeTreeList(FormCollection form)
        {
            var    nodes    = new List <JsonTreeNode>();
            string parentId = form["id"];// ?? "0";

            List <Privilege> list = sysManageService.GetChildPrivileges(parentId);

            if (list != null)
            {
                foreach (var item in list)
                {
                    JsonTreeNode node = new JsonTreeNode();
                    node.id          = item.PrivilegeCode;
                    node.text        = item.PrivilegeName;
                    node.value       = item.Uri;
                    node.hasChildren = item.HasChild;
                    nodes.Add(node);
                }
                if (parentId == null && nodes.Count > 0 && nodes[0].hasChildren) //如果是根
                {
                    List <Privilege> clist = sysManageService.GetChildPrivileges(nodes[0].id);
                    nodes[0].complete = true;
                    nodes[0].isexpand = true;
                    if (clist != null)
                    {
                        foreach (var citem in clist)
                        {
                            JsonTreeNode cnode = new JsonTreeNode();
                            cnode.id          = citem.PrivilegeCode;
                            cnode.text        = citem.PrivilegeName;
                            cnode.value       = citem.Uri;
                            cnode.hasChildren = citem.HasChild;
                            nodes[0].ChildNodes.Add(cnode);
                        }
                    }
                }
            }
            return(Json(nodes));
        }