Beispiel #1
0
        /// <summary>
        /// 签名
        /// </summary>
        /// <returns></returns>
        internal static string getSign(SortedDictionary <string, string> pairs)
        {
            List <String> list   = pairs.Select(A => String.Format("{0}={1}", A.Key, A.Value)).ToList();
            String        result = String.Join("&", list);

            result += ConfigUtils.key;
            result  = MD5Untils.GetMd5(result);
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 签名
        /// </summary>
        /// <returns></returns>
        internal static Boolean verifySign(SortedDictionary <string, string> pairs, String sign)
        {
            List <String> list   = pairs.Select(A => String.Format("{0}={1}", A.Key, A.Value)).ToList();
            String        result = String.Join("&", list);

            result += ConfigUtils.key;
            result  = MD5Untils.GetMd5(result);
            Boolean flag = result.ToUpper() == sign.ToUpper();

            return(flag);
        }
Beispiel #3
0
        public Newtonsoft.Json.Linq.JObject getPostParam([FromBody] RequestParam login)
        {
            FileLogUtils.Debug("getPostParam", login.ToJsonString(), false);

            if (login == null)
            {
                login = new RequestParam();
            }
            Newtonsoft.Json.Linq.JObject jobject = null;
            try
            {
                String sessionCode = "";
                if (HttpContext.Current.Session != null && HttpContext.Current.Session["CheckCode"] != null)
                {
                    sessionCode = HttpContext.Current.Session["CheckCode"].ToString();
                }

                login.uip = ResponseHandler.GetIPAddress();
                Result1 result = SDK.getPostParam(login, sessionCode);
                if (result.status == "1")
                {
                    String newSessionId = MD5Untils.GetMd5(TimeUntils.GetNow() + CommonUntils.CreateRandomCode(5)).ToUpper();
                    HttpContext.Current.Session[newSessionId] = result.message;
                    result.message = newSessionId;
                }

                String jsonString = result.ToJsonString();
                FileLogUtils.Debug("getPostParam", jsonString, true);
                jobject = jsonString.ConvertJObject();
            }
            catch (Exception ex)
            {
                FileLogUtils.Error("getPostParam", ex.Message);
            }
            return(jobject);
        }