AuthorDesign/Areas/Admin/Controllers/AdminController.cs
(开头部分) 14KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using AuthorDesign.Common;
using AuthorDesign.Web.App_Start.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
namespace AuthorDesign.Web.Areas.Admin.Controllers
{
[AdminAuthory]// 添加权限控制
public class AdminController : Controller
{
//
// GET: /Admin/Admin/
/// <summary>
/// 设置当前的路径与操作代码
/// </summary>
/// <returns></returns>
[AdminActionMethod(RoleCode = "LookRole", ActionUrl = "Admin/AdminList")]
public ActionResult AdminList()
{
ViewBag.Title = "管理员列表";
ViewBag.RoleSelectItem = SelectItemHelper.GetRoleItemList(0);
return View();
}
[HttpPost]
public JsonResult AdminList(Models.AdminParamModel model) {
int rowCount = 0;
var result = EnterRepository.GetRepositoryEnter().GetAdminRepository.LoadPageList(model.RoleId, model.Mobile, model.iDisplayStart, model.iDisplayLength, model.IsDesc, out rowCount);
return Json(new {
sEcho = model.sEcho,
iTotalRecords = rowCount,
iTotalDisplayRecords = rowCount,
aaData = result
}, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// 获取管理员信息
/// </summary>
/// <param name="id">管理员Id</param>
/// <returns></returns>
[HttpPost]
[AdminActionMethod(RoleCode = "LookRole", ActionUrl = "Admin/AdminList",ActionResultType=1)]
public JsonResult GetAdminInfo(int id = 0) {
var result = EnterRepository.GetRepositoryEnter().GetAdminRepository.LoadEntities(m => m.Id == id && m.IsSuperAdmin == 0).FirstOrDefault();
if (result == null) {
return Json(new { state = "error", message = "无法找到该管理员信息" });
}
else {
return Json(new { state = "success", result });
}
}
/// <summary>
/// 添加管理员
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
后面还有 235 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
