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;
 }
Exemple #3
0
        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);
        }
Exemple #4
0
 public DashboardController(IAnalysisService analysisService,
                            IEmployeeService employeeService, ISysAdminService sysAdminService)
 {
     _analysisService = analysisService;
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
 }
Exemple #5
0
 public ProjectController(IEmployeeService employeeService,
                          ISysAdminService sysAdminService, IProjectService projectService)
 {
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
     _projectService  = projectService;
 }
Exemple #6
0
 public NoticeController(
     ISysAdminService adminService,
     ISysNoticeService noticeService)
 {
     _adminService  = adminService;
     _noticeService = noticeService;
 }
Exemple #7
0
 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;
 }
Exemple #9
0
 public HomeController(ISysSiteService siteService,
                       ISysAdminService adminService,
                       ISysMenuService sysMenuService,
                       ISysLogService sysLogService,
                       IHttpContextAccessor httpContextAccessor)
 {
     _siteService         = siteService;
     _adminService        = adminService;
     _sysMenuService      = sysMenuService;
     _sysLogService       = sysLogService;
     _httpContextAccessor = httpContextAccessor;
 }
Exemple #10
0
 public AdminController(
     ISysAdminService adminService,
     ISysLogService logService,
     IConfiguration config,
     IDistributedCache cache,
     ICmsShopService shop) : base(cache)
 {
     _adminService = adminService;
     _logService   = logService;
     _config       = config;
     _cache        = cache;
     _shop         = shop;
 }
Exemple #11
0
 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;
 }
Exemple #12
0
        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);
        }
Exemple #13
0
 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);
             }
         }
     }
 }
Exemple #14
0
 public AdminController(ISysAdminService sysAdminService, ISysRoleService sysRoleService, IWebHostEnvironment environment)
 {
     _sysAdminService = sysAdminService;
     _sysRoleService  = sysRoleService;
     _environment     = environment;
 }
Exemple #15
0
 public AgentDetailModel(ICmsAgentService agent, ICmsLevelService level, ISysAdminService admin)
 {
     _agent = agent;
     _admin = admin;
     _level = level;
 }
 public AdminController(ISysAdminService adminService, ISysLogService logService)
 {
     _adminService = adminService;
     _logService   = logService;
 }
Exemple #17
0
 public WeatherForecastController(ISysAdminService adminService
                                  , IBuilderTool toolService)
 {
     _adminService = adminService;
     _toolService  = toolService;
 }
Exemple #18
0
 public EmployeeController(IEmployeeService employeeService, ISysAdminService sysAdminService)
 {
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
 }
Exemple #19
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger
                                  , ISysAdminService adminService)
 {
     _logger       = logger;
     _adminService = adminService;
 }
Exemple #20
0
 public IndexModel(ICmsSiteService siteService, ISysAdminService adminService)
 {
     _siteService  = siteService;
     _adminService = adminService;
 }
Exemple #21
0
 public LoginModel(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Exemple #22
0
 public ValuesController(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Exemple #23
0
 public DefaultModel(ICmsSiteService siteService, ISysAdminService adminService)
 {
     _siteService  = siteService;
     _adminService = adminService;
 }
Exemple #24
0
 public CmsAgentService(ISysAdminService sysAdmin, ISysPermissionsService sysPermissions, IConfiguration config) : base(config)
 {
     this.sysAdmin       = sysAdmin;
     this.sysPermissions = sysPermissions;
 }
Exemple #25
0
 public RoleController(ISysRoleService roleService, ISysAdminService adminService)
 {
     _roleService  = roleService;
     _adminService = adminService;
 }
Exemple #26
0
 public AdminController(ISysAdminService adminService)
 {
     _adminService = adminService;
 }
Exemple #27
0
 public SysAdminController(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Exemple #28
0
 public AccountController(ISysAdminService sysAdminService)
 {
     this.sysAdminService = sysAdminService;
 }
 public AdminModifyModel(ISysAdminService adminService)
 {
     _adminService = adminService;
 }