check bugs

This commit is contained in:
yubaolee
2017-02-28 16:51:07 +08:00
parent 02742c5ad4
commit 91dfa83e6f
7 changed files with 83 additions and 58 deletions

View File

@@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Infrastructure;
using LeaRun.Util.WebControl;
using OpenAuth.App;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain;
using OpenAuth.Mvc.Models;
namespace OpenAuth.Mvc.Controllers
@@ -66,6 +69,59 @@ namespace OpenAuth.Mvc.Controllers
return JsonHelper.Instance.Serialize(Result);
}
#region
/// <summary>
/// 用户列表树
/// </summary>
/// <returns>返回树形Json</returns>
[HttpGet]
public ActionResult GetUserCheckTreeJson()
{
var treeList = new List<TreeEntity>();
string companyid = "";
string departmentid = "";
foreach (UserView item in _app.Load(Guid.Empty, 1, 10).rows)
{
TreeEntity tree = new TreeEntity();
tree.id = item.Id.ToString();
tree.text = item.Name;
tree.value = item.Id.ToString();
tree.isexpand = true;
tree.complete = true;
tree.hasChildren = false;
tree.parentId = "0";
tree.showcheck = true;
tree.img = "fa fa-user";
tree.Attribute = "mytype";
tree.AttributeValue = "User";
treeList.Add(tree);
}
return Content(treeList.TreeToJson());
}
/// <summary>
/// 获取用户可访问的账号
/// <para>李玉宝于2017-02-28 15:12:19</para>
/// </summary>
public string GetAccessedUsers()
{
IEnumerable<UserView> users = _app.Load(Guid.Empty, 1, 10).rows;
var result = new Dictionary<string , object>();
foreach (var user in users)
{
var item = new
{
Account = user.Account,
RealName = user.Name,
};
result.Add(user.Id.ToString(), item);
}
return JsonHelper.Instance.Serialize(result);
}
#endregion
}
}