Пример #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);
 }
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            if (String.IsNullOrEmpty(OpenAPIHelper.HostUrl))
            {
                //装载当前URI
                OpenAPIHelper.HostUrl = actionContext.Request.RequestUri.Scheme + "://" + actionContext.Request.RequestUri.Authority;
            }

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

            OpenAPIHelper.CheckBaseParamsAndSign(data);
            base.OnActionExecuting(actionContext);
        }