Beispiel #1
0
        /// <summary>
        /// 检查Post数据准确性
        /// </summary>
        public static DataMode.AllCheckReturn CheckPostData(HttpRequestBase Request, Type NowType, string FunctionName, string JsonData, string CusID, string KeyMd5)
        {
            DataMode.AllCheckReturn CheckReturn = new DataMode.AllCheckReturn();
            CheckReturn.State = false;
            var _RetObject = new Model.GeneralReturns();

            _RetObject.State   = true;
            _RetObject.MsgText = string.Empty;
            string CusKey = InsertData.SaveClientInfo(GetIp(Request), FunctionName, CusID, KeyMd5);

            if (CusKey == string.Empty)
            {
                _RetObject.State   = false;
                _RetObject.MsgText = "错误的CusID";
            }
            else
            {
                if (HttpHelper.GetMD5Hash(JsonData + CusKey) != KeyMd5)
                {
                    _RetObject.State   = false;
                    _RetObject.MsgText = "Key验证错误";
                }
                else
                {
                    JsonData = HttpUtility.UrlDecode(JsonData, Encoding.UTF8);
                    JsonData = UniDecode(JsonData);
                    string str = System.Text.RegularExpressions.Regex.Replace(JsonData, @"\\s*|\t|\r|\n|\\", "");
                    var    Obj = HttpHelper.JsonToObject(str, NowType);
                    if (HttpHelper.JsonErrorText != string.Empty)
                    {
                        _RetObject.State   = false;
                        _RetObject.MsgText = "错误的Json格式数据[" + HttpHelper.JsonErrorText + "]";
                    }
                    else
                    {
                        CheckReturn.State      = true;
                        CheckReturn.JsonObject = Obj;
                    }
                }
            }
            CheckReturn.ReturnMode = _RetObject;
            return(CheckReturn);
        }
Beispiel #2
0
 /// <summary>
 /// 获取服务器[Wsy_androidpda]版本号Json格式 包含vosoin版本号 geturl 下载链接 Rem 更新说明
 /// </summary>
 private Model.GeneralReturns GetVosionNo(Model.M_GetVosionNo.Request S)
 {
     Model.GeneralReturns gr = new Model.GeneralReturns();
     gr.ReturnJson = Common.DataHandling.ObjToJson(new BLL.Bll_GetVosionNo().GetVosionNo());
     return(gr);
 }