/// <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); }
//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)); }