Exemplo n.º 1
0
 protected override ShutdownDelayParam ConvertParam(PcActionParam param)
 {
     return(new ShutdownDelayParam()
     {
         Minute = AppConfigManger.GetConfig().ActionConfig.ShutdownNowActionConfig.DefaultShutdownMinute
     });
 }
Exemplo n.º 2
0
        public ExecuteAppAction()
        {
            var exeList = AppConfigManger.GetConfig().ActionConfig.ExecuteAppActionConfig.ExeAppConfig;

            if (exeList != null)
            {
                this.appList = exeList;
            }
        }
Exemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddOptions();

            var myAppConfig = Configuration.GetSection("MyAppConfig");

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            AppConfigManger.Init(myAppConfig.Get <AppConfig>());
        }
 public void OnActionExecuting(ActionExecutingContext context)
 {
     if (context.HttpContext.Request.Headers.ContainsKey("token"))
     {
         var token = context.HttpContext.Request.Headers["token"];
         if (token != AppConfigManger.GetConfig().Token)
         {
             context.Result = new JsonResult(new PcActionResult()
             {
                 Msg     = "权限验证失败",
                 Success = false
             });
         }
     }
     else
     {
         context.Result = new JsonResult(new PcActionResult()
         {
             Msg     = "未设置权限信息",
             Success = false
         });
     }
 }