mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-23 20:43:33 +08:00
Routine Update
This commit is contained in:
@@ -69,6 +69,11 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
loginUser.Modules = _moduleRepository.Find(null).MapToList<ModuleView>();
|
loginUser.Modules = _moduleRepository.Find(null).MapToList<ModuleView>();
|
||||||
|
//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ˵<C4B2>
|
||||||
|
foreach (var module in loginUser.Modules)
|
||||||
|
{
|
||||||
|
module.Elements = _moduleElementRepository.Find(u => u.ModuleId == module.Id).ToList();
|
||||||
|
}
|
||||||
return loginUser;
|
return loginUser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,11 +12,10 @@
|
|||||||
// <summary>基础控制器,设置权限</summary>
|
// <summary>基础控制器,设置权限</summary>
|
||||||
// ***********************************************************************
|
// ***********************************************************************
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using Infrastructure.Helper;
|
using Infrastructure.Helper;
|
||||||
using OpenAuth.App.ViewModel;
|
using OpenAuth.App.ViewModel;
|
||||||
using OpenAuth.Mvc.Models;
|
using OpenAuth.Mvc.Models;
|
||||||
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Controllers
|
namespace OpenAuth.Mvc.Controllers
|
||||||
@@ -34,18 +33,22 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Request.Url != null)
|
|
||||||
{
|
|
||||||
string url = Request.Url.LocalPath;
|
string url = Request.Url.LocalPath;
|
||||||
if (url != "/"
|
if (url != "/"
|
||||||
&& !url.Contains("Main")
|
&& !url.Contains("Main")
|
||||||
&& !url.Contains("Error")
|
&& !url.Contains("Error")
|
||||||
&& !url.Contains("Git")
|
&& !url.Contains("Git"))
|
||||||
&& !loginUser.Modules.Any(u => url.Contains(u.Url)))
|
{
|
||||||
|
var module = loginUser.Modules.FirstOrDefault(u => url.Contains(u.Url));
|
||||||
|
if (module == null)
|
||||||
{
|
{
|
||||||
filterContext.Result = new RedirectResult("/Login/Index");
|
filterContext.Result = new RedirectResult("/Login/Index");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ViewBag.Module = module;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
base.OnActionExecuting(filterContext);
|
base.OnActionExecuting(filterContext);
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,15 @@
|
|||||||
$('#@_treeDetail').empty()
|
$('#@_treeDetail').empty()
|
||||||
.append('<table id="@_gridId" class="table table-bordered"></table>');
|
.append('<table id="@_gridId" class="table table-bordered"></table>');
|
||||||
|
|
||||||
|
@{
|
||||||
|
string strBtns = string.Empty;
|
||||||
|
foreach (var element in ViewBag.Module.Elements)
|
||||||
|
{
|
||||||
|
strBtns +="<button type=\"button\" class =\"btn btn-green\">"+element.Name +"</button>";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
grid = $(gridid).datagrid({
|
grid = $(gridid).datagrid({
|
||||||
gridTitle: '用户列表',
|
gridTitle: '用户列表',
|
||||||
showToolbar: true,
|
showToolbar: true,
|
||||||
@@ -38,7 +47,7 @@
|
|||||||
'data-toggle="dialog" data-id="dialog-mask" data-mask="true" data-on-close="refreshGrid">添加</a>' +
|
'data-toggle="dialog" data-id="dialog-mask" data-mask="true" data-on-close="refreshGrid">添加</a>' +
|
||||||
'<button class=" btn-green" onclick="editOrg()" data-icon="pencil" type="button">编辑</button>' +
|
'<button class=" btn-green" onclick="editOrg()" data-icon="pencil" type="button">编辑</button>' +
|
||||||
'<button type="button" class="btn btn-green" onclick="openModuleAccess(this)">为用户分配模块</button>' +
|
'<button type="button" class="btn btn-green" onclick="openModuleAccess(this)">为用户分配模块</button>' +
|
||||||
'<button type="button" class ="btn btn-green" onclick="openRoleAccess(this)">为用户分配角色</button>',
|
'<button type="button" class ="btn btn-green" onclick="openRoleAccess(this)">为用户分配角色</button>' + '@strBtns',
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
name: 'Id',
|
name: 'Id',
|
||||||
|
Reference in New Issue
Block a user