mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +08:00
引入ztree
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App.SSO;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
@@ -18,11 +16,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
public string GetNavBar()
|
||||
{
|
||||
var user = AuthUtil.GetCurrentUser();
|
||||
return JsonHelper.Instance.Serialize(user.ModuleWithChildren);
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Git()
|
||||
{
|
||||
|
@@ -28,7 +28,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
|
||||
var moduleWithChildren = AuthUtil.GetCurrentUser().ModuleWithChildren;
|
||||
var moduleWithChildren = AuthUtil.GetCurrentUser().Modules.GenerateTree(u =>u.Id, u =>u.ParentId);
|
||||
var modules = key == "UserModule" ? App.LoadForUser(firstId) : App.LoadForRole(firstId);
|
||||
|
||||
CheckModule(moduleWithChildren, modules);
|
||||
|
30
OpenAuth.Mvc/Controllers/UserSessionController.cs
Normal file
30
OpenAuth.Mvc/Controllers/UserSessionController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App.SSO;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取登陆用户的全部信息
|
||||
/// </summary>
|
||||
public class UserSessionController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取登陆用户可访问的所有模块,及模块的操作菜单
|
||||
/// </summary>
|
||||
public string GetModulesTree()
|
||||
{
|
||||
var user = AuthUtil.GetCurrentUser();
|
||||
return JsonHelper.Instance.Serialize(user.Modules.GenerateTree(u => u.Id, u => u.ParentId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取登陆用户可访问的所有部门
|
||||
/// </summary>
|
||||
public string GetOrgsTree()
|
||||
{
|
||||
var user = AuthUtil.GetCurrentUser();
|
||||
return JsonHelper.Instance.Serialize(user.Orgs.GenerateTree(u => u.Id, u => u.ParentId));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user