Elight.WebUI/Areas/Sys/Controllers/RoleAuthorizeController.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Elight.WebUI.Filters;
using Elight.Logic.Sys;
using Elight.Utility.ResponseModels;
using Elight.Utility.Core;
using Elight.Utility.Operator;
using Elight.WebUI.Controllers;
using Elight.Entity.Sys;
namespace MES.WebUI.Areas.Sys.Controllers
{
[HiddenApi]
[Area("Sys")]
public class RoleAuthorizeController : BaseController
{
private SysRoleAuthorizeLogic roleAuthorizeLogic;
private SysPermissionLogic permissionLogic;
public RoleAuthorizeController()
{
roleAuthorizeLogic = new SysRoleAuthorizeLogic();
permissionLogic = new SysPermissionLogic();
}
[Route("system/roleAuthorize/index")]
[HttpGet, AuthorizeChecked]
public ActionResult Index()
{
return View();
}
[Route("system/roleAuthorize/index")]
[HttpPost, AuthorizeChecked]
public ActionResult Index(string roleId)
{
var listPerIds = roleAuthorizeLogic.GetList(roleId).Select(c => c.ModuleId).ToList();
List<SysPermission> listAllPers;
if (OperatorProvider.Instance.Current.Account == "admin")
{
listAllPers = permissionLogic.GetList();
}
else
{
listAllPers = permissionLogic.GetList(OperatorProvider.Instance.Current.UserId);
}
listAllPers = Handle(listAllPers);
List<ZTreeNode> result = new List<ZTreeNode>();
foreach (var item in listAllPers)
{
ZTreeNode model = new ZTreeNode();
model.@checked = listPerIds.Contains(item.Id) ? model.@checked = true : model.@checked = false;
model.id = item.Id;
model.pId = item.ParentId;
model.name = item.Name;
model.open = true;
后面还有 90 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。