Пример #1
0
 /// <summary>
 /// 检测参数签名
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public void CheckParamsSign(SortedDictionary <string, string> data = null)
 {
     if (data == null)
     {
         data = GetSortedParams();
     }
     OpenAPIHelper.CheckBaseParamsAndSign(data);
 }
Пример #2
0
        public override void OnActionExecuting(ActionExecutingContext actionContext)
        {
            if (String.IsNullOrEmpty(OpenAPIHelper.HostUrl))
            {
                //装载当前URI
                OpenAPIHelper.HostUrl = actionContext.HttpContext.Request.Scheme + "://" + actionContext.HttpContext.Request.Host.ToString();
            }

            var data = OpenAPIHelper.GetSortedParams(actionContext.HttpContext.Request);

            OpenAPIHelper.CheckBaseParamsAndSign(data);
            base.OnActionExecuting(actionContext);
        }
Пример #3
0
 protected void Application_Start()
 {
     GlobalHost.ApiLogger = new APILogger();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     OpenAPIHelper.Init();
 }
Пример #4
0
        //private HiOpenAPIController()
        //{
        //    if (String.IsNullOrEmpty(OpenAPIHelper.HostUrl))
        //        OpenAPIHelper.HostUrl = "http://" + Url.Request.RequestUri.Host;
        //}

        /// <summary>
        /// 获取传递参数转换成字典
        /// </summary>
        /// <returns></returns>
        protected SortedDictionary <string, string> GetSortedParams()
        {
            return(OpenAPIHelper.GetSortedParams(Request));
        }
Пример #5
0
 protected void Application_Start()
 {
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     OpenAPIHelper.Init();
 }