This commit is contained in:
yubao
2017-12-16 23:29:38 +08:00
parent 277676cbba
commit a904438b94
5 changed files with 116 additions and 52 deletions

View File

@@ -36,8 +36,17 @@ namespace OpenAuth.Mvc.Controllers
/// <returns>System.String.</returns>
public string LoadForUser(string firstId)
{
var orgs = App.LoadForUser(firstId);
return JsonHelper.Instance.Serialize(orgs);
var modules = App.LoadForUser(firstId);
return JsonHelper.Instance.Serialize(modules);
}
/// <summary>
/// 根据某用户ID获取可访问某模块的菜单项
/// </summary>
/// <returns></returns>
public string LoadMenusForUser(string moduleId, string firstId)
{
var menus = App.LoadMenusForUser(moduleId, firstId);
return JsonHelper.Instance.Serialize(menus);
}
/// <summary>
@@ -47,8 +56,18 @@ namespace OpenAuth.Mvc.Controllers
/// <returns>System.String.</returns>
public string LoadForRole(string firstId)
{
var orgs = App.LoadForRole(firstId);
return JsonHelper.Instance.Serialize(orgs);
var modules = App.LoadForRole(firstId);
return JsonHelper.Instance.Serialize(modules);
}
/// <summary>
/// 根据某角色ID获取可访问某模块的菜单项
/// </summary>
/// <returns></returns>
public string LoadMenusForRole(string moduleId, string firstId)
{
var menus = App.LoadMenusForRole(moduleId, firstId);
return JsonHelper.Instance.Serialize(menus);
}
#region

View File

@@ -1,41 +1,41 @@
using System;
using System.Web.Mvc;
using Infrastructure;
using OpenAuth.App;
namespace OpenAuth.Mvc.Controllers
{
public class RelevanceManagerController : BaseController
{
public RevelanceManagerApp App { get; set; }
[HttpPost]
public string Assign(string type, string firstId, string[] secIds)
{
try
{
App.Assign(type, firstId, secIds);
}
catch (Exception ex)
{
Result.Code = 500;
Result.Message = ex.Message;
}
return JsonHelper.Instance.Serialize(Result);
}
[HttpPost]
public string UnAssign(string type, string firstId, string[] secIds)
{
try
{
App.UnAssign(type, firstId, secIds);
}
catch (Exception ex)
{
Result.Code = 500;
Result.Message = ex.Message;
}
return JsonHelper.Instance.Serialize(Result);
}
}
using System;
using System.Web.Mvc;
using Infrastructure;
using OpenAuth.App;
namespace OpenAuth.Mvc.Controllers
{
public class RelevanceManagerController : BaseController
{
public RevelanceManagerApp App { get; set; }
[HttpPost]
public string Assign(string type, string firstId, string[] secIds)
{
try
{
App.Assign(type, firstId, secIds);
}
catch (Exception ex)
{
Result.Code = 500;
Result.Message = ex.Message;
}
return JsonHelper.Instance.Serialize(Result);
}
[HttpPost]
public string UnAssign(string type, string firstId, string[] secIds)
{
try
{
App.UnAssign(type, firstId, secIds);
}
catch (Exception ex)
{
Result.Code = 500;
Result.Message = ex.Message;
}
return JsonHelper.Instance.Serialize(Result);
}
}
}