mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 10:08:04 +08:00
ru
This commit is contained in:
@@ -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 添加编辑模块
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user