public AdminController(ILogger <AdminController> logger, ISysAdminService adminService, LoginModel.LoginModel loginModel) { _logger = logger; ///测试IOC _adminService = adminService; _loginModel = loginModel; }
public SysAdminController(ILogger <SysAdminController> logger, ISysAdminService sysAdminService, IApiLogRepository apiLogRepository, IUserRepository userRepository) { _logger = logger; _sysAdminService = sysAdminService; _apiLogRepository = apiLogRepository; _userRepository = userRepository; }
protected override bool AuthorizeCore(HttpContextBase httpContext) { if (!httpContext.User.Identity.IsAuthenticated) { return(false); } //根据用户角色 string actionName = httpContext.Request.RequestContext.RouteData.Values["action"].ToString().ToLower(); string controllerName = httpContext.Request.RequestContext.RouteData.Values["controller"].ToString().ToLower(); string httpMethod = httpContext.Request.HttpMethod.ToLower(); ISysAdminService sysAdminService = IOC.Resolve <ISysAdminService>(); //判断是否超级管理员 var sysAdmin = sysAdminService.Get(m => m.IsAdmin && m.UserName == httpContext.User.Identity.Name); if (sysAdmin != null && sysAdmin.Id > 0) { return(base.AuthorizeCore(httpContext)); } ISysAdminRoleService sysAdminRoleService = IOC.Resolve <ISysAdminRoleService>(); var entity = sysAdminRoleService.Get(m => m.SysRole.SysRoleMenu.Any(w => w.SysMenu.Controller.ToLower() == controllerName && w.SysMenu.Action.ToLower() == actionName)); if (entity != null && entity.Id > 0) { return(base.AuthorizeCore(httpContext)); } return(false); }
public DashboardController(IAnalysisService analysisService, IEmployeeService employeeService, ISysAdminService sysAdminService) { _analysisService = analysisService; _employeeService = employeeService; _sysAdminService = sysAdminService; }
public ProjectController(IEmployeeService employeeService, ISysAdminService sysAdminService, IProjectService projectService) { _employeeService = employeeService; _sysAdminService = sysAdminService; _projectService = projectService; }
public NoticeController( ISysAdminService adminService, ISysNoticeService noticeService) { _adminService = adminService; _noticeService = noticeService; }
public LoginController(ISysAdminService adminService, ISysLogService logService, IHttpContextAccessor httpContextAccessor) { _adminService = adminService; _logService = logService; _httpContextAccessor = httpContextAccessor; }
public AdminController(ISysAdminService adminService, ISysLogService logService, ICacheService cacheService, ICmsSiteService siteService) { _adminService = adminService; _logService = logService; _cacheService = cacheService; _siteService = siteService; }
public HomeController(ISysSiteService siteService, ISysAdminService adminService, ISysMenuService sysMenuService, ISysLogService sysLogService, IHttpContextAccessor httpContextAccessor) { _siteService = siteService; _adminService = adminService; _sysMenuService = sysMenuService; _sysLogService = sysLogService; _httpContextAccessor = httpContextAccessor; }
public AdminController( ISysAdminService adminService, ISysLogService logService, IConfiguration config, IDistributedCache cache, ICmsShopService shop) : base(cache) { _adminService = adminService; _logService = logService; _config = config; _cache = cache; _shop = shop; }
public AuthorityController(ISysActionService sysActionService, ISysAdminService sysAdminService, ISysRoleService sysRoleService, ISysRoleActionService sysRoleActionService, ISysAdminRoleService sysAdminRoleService, ISysMenuService sysMenuService) { _sysActionService = sysActionService; _sysAdminService = sysAdminService; _sysRoleService = sysRoleService; _sysRoleActionService = sysRoleActionService; _sysAdminRoleService = sysAdminRoleService; _sysMenuService = sysMenuService; }
internal static async Task WriteExcelReference(MemoryStream stream, ISysAdminService sysAdminService) { IWorkbook workbook = new XSSFWorkbook(); IDataFormat dataformat = workbook.CreateDataFormat(); ICellStyle dateStyle = workbook.CreateCellStyle(); dateStyle.DataFormat = dataformat.GetFormat("yyyy-MM-dd"); ISheet orgSheet = workbook.CreateSheet("Organizations"); ISheet specSheet = workbook.CreateSheet("Specialties"); FullSheet <Entity.Organization>(await sysAdminService.GetOrganiztions(), orgSheet, dateStyle); FullSheet <Entity.Reference>(await sysAdminService.GetReferences(Entity.ReferenceTypeEnum.Specialty), specSheet, dateStyle); workbook.Write(stream); }
public SystemController(ISysAdminService sysAdminService, IUserManager userManager, IProjectService projectService, IEmployeeService employeeService, IOptionsSnapshot <List <ExcelMap> > options) { _sysAdminSvc = sysAdminService; _userManager = userManager; _projectService = projectService; _employeeService = employeeService; if (options != null) { _excelMappings = new Dictionary <string, ExcelMap>(); foreach (var map in options.Value) { if (!_excelMappings.ContainsKey(map.EntityName)) { _excelMappings.Add(map.EntityName, map); } } } }
public AdminController(ISysAdminService sysAdminService, ISysRoleService sysRoleService, IWebHostEnvironment environment) { _sysAdminService = sysAdminService; _sysRoleService = sysRoleService; _environment = environment; }
public AgentDetailModel(ICmsAgentService agent, ICmsLevelService level, ISysAdminService admin) { _agent = agent; _admin = admin; _level = level; }
public AdminController(ISysAdminService adminService, ISysLogService logService) { _adminService = adminService; _logService = logService; }
public WeatherForecastController(ISysAdminService adminService , IBuilderTool toolService) { _adminService = adminService; _toolService = toolService; }
public EmployeeController(IEmployeeService employeeService, ISysAdminService sysAdminService) { _employeeService = employeeService; _sysAdminService = sysAdminService; }
public WeatherForecastController(ILogger <WeatherForecastController> logger , ISysAdminService adminService) { _logger = logger; _adminService = adminService; }
public IndexModel(ICmsSiteService siteService, ISysAdminService adminService) { _siteService = siteService; _adminService = adminService; }
public LoginModel(ISysAdminService sysAdminService) { _sysAdminService = sysAdminService; }
public ValuesController(ISysAdminService sysAdminService) { _sysAdminService = sysAdminService; }
public DefaultModel(ICmsSiteService siteService, ISysAdminService adminService) { _siteService = siteService; _adminService = adminService; }
public CmsAgentService(ISysAdminService sysAdmin, ISysPermissionsService sysPermissions, IConfiguration config) : base(config) { this.sysAdmin = sysAdmin; this.sysPermissions = sysPermissions; }
public RoleController(ISysRoleService roleService, ISysAdminService adminService) { _roleService = roleService; _adminService = adminService; }
public AdminController(ISysAdminService adminService) { _adminService = adminService; }
public SysAdminController(ISysAdminService sysAdminService) { _sysAdminService = sysAdminService; }
public AccountController(ISysAdminService sysAdminService) { this.sysAdminService = sysAdminService; }
public AdminModifyModel(ISysAdminService adminService) { _adminService = adminService; }