Beispiel #1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     StructureMapWapper.Init();
     log4net.Config.XmlConfigurator.Configure(new FileInfo(Server.MapPath("~/Config/log4net_Sqlserver.config")));
 }
Beispiel #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            StructureMapWapper.Init();
        }
Beispiel #3
0
        public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext)
        {
            try
            {
                string loginName = GetLoginNameFromHttpContext(actionContext);
                if (string.IsNullOrEmpty(loginName))
                {
                    actionContext.Response = new HttpResponseMessage(HttpStatusCode.Forbidden);
                    actionContext.Response.ReasonPhrase = "请登录";
                    return;
                }

                if (actionContext.ActionDescriptor.GetCustomAttributes <AllowAnonymousAttribute>().Count > 0)   // 允许匿名访问
                {
                    base.OnActionExecuting(actionContext);
                    return;
                }

                // TODO: sessionkey过期或不存在就拒绝 调用BLL方法验证
                var    accountService = StructureMapWapper.GetInstance <IAccountService>();
                string sessionKey     = string.Empty;
                if (!accountService.CheckSessionIsExpired(loginName, out sessionKey))
                {
                    actionContext.Response = new HttpResponseMessage(HttpStatusCode.Forbidden);
                    actionContext.Response.ReasonPhrase = "会话超时,请重新登录";
                    return;
                }

                base.OnActionExecuting(actionContext);
            }
            catch (Exception ex)
            {
                actionContext.Response = new HttpResponseMessage(HttpStatusCode.Forbidden);
                actionContext.Response.ReasonPhrase = ex.Message;
            }
        }
 public BaseService()
 {
     baseDao = StructureMapWapper.GetInstance <IDaoFrame>();
 }
Beispiel #5
0
 public RoleController()
 {
     roleService     = StructureMapWapper.GetInstance <IRoleService>();
     roleMenuService = StructureMapWapper.GetInstance <IRoleMenuService>();
 }
Beispiel #6
0
 public LoginLogService()
 {
     loginLogDao = StructureMapWapper.GetInstance <ILoginLogDao>();
 }
Beispiel #7
0
 public TableMgrController()
 {
     baseService = StructureMapWapper.GetInstance <IBaseService>();
 }
Beispiel #8
0
 public RoleService()
 {
     roleDao = StructureMapWapper.GetInstance <IRoleDao>();
 }
Beispiel #9
0
 public ControlController()
 {
     roleMenuService = StructureMapWapper.GetInstance <IRoleMenuService>();
     userRoleService = StructureMapWapper.GetInstance <IUserRoleService>();
 }
Beispiel #10
0
 public UserController()
 {
     userRoleService = StructureMapWapper.GetInstance <IUserRoleService>();
 }
Beispiel #11
0
 public AccountController()
 {
     accountService = StructureMapWapper.GetInstance <IAccountService>();
 }
Beispiel #12
0
 public AccountService()
 {
     accountDao  = StructureMapWapper.GetInstance <IAccountDao>();
     loginLogDao = StructureMapWapper.GetInstance <ILoginLogDao>();
 }
Beispiel #13
0
 public MenuService()
 {
     menuDao = StructureMapWapper.GetInstance <IMenuDao>();
 }
Beispiel #14
0
 public CustomizeController()
 {
     baseService = StructureMapWapper.GetInstance <IBaseService>();
 }
Beispiel #15
0
 public AdminBaseController()
 {
     userService     = StructureMapWapper.GetInstance <IUserService>();
     pageViewService = StructureMapWapper.GetInstance <IPageViewService>();
     menuService     = StructureMapWapper.GetInstance <IMenuService>();
 }
Beispiel #16
0
 public UserService()
 {
     userDao = StructureMapWapper.GetInstance <IUserDao>();
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 public TUSERService()
 {
     tuserDao = StructureMapWapper.GetInstance <ITUSERDao>();
 }
Beispiel #18
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public VR_SITESService()
 {
     vr_sitesDao = StructureMapWapper.GetInstance <IVR_SITESDao>();
 }
Beispiel #19
0
 public MenuDataUtil()
 {
     daoFrame = StructureMapWapper.GetInstance <IDaoFrame>();
 }
Beispiel #20
0
 public PageViewService()
 {
     pageViewDao = StructureMapWapper.GetInstance <IPageViewDao>();
 }
 public AdminBaseController()
 {
     userService     = StructureMapWapper.GetInstance <ITUSERService>();
     vr_sitesService = StructureMapWapper.GetInstance <IVR_SITESService>();
     vr_visitService = StructureMapWapper.GetInstance <IVR_VISITService>();
 }
Beispiel #22
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public VR_VISITService()
 {
     vr_visitDao = StructureMapWapper.GetInstance <IVR_VISITDao>();
 }