Ejemplo n.º 1
0
        /// <summary>
        /// 接口签名验证
        /// </summary>
        /// <param name="signStr">待验证签名字符串</param>
        /// <param name="signData">验证签名数据</param>
        /// <returns></returns>
        public static AjaxJsonValid VerifySignData(string signStr, string signData)
        {
            AjaxJsonValid ajv = new AjaxJsonValid();

            if (!string.IsNullOrEmpty(signData) && Utility.MD5(signStr) == signData)
            {
                return(ajv);
            }
            ajv.code = (int)ApiCode.VertySignErrorCode;
            ajv.msg  = EnumHelper.GetDesc(ApiCode.VertySignErrorCode);
            return(ajv);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 接口签名验证
        /// </summary>
        /// <param name="signStr">待验证签名字符串</param>
        /// <param name="signData">验证签名数据</param>
        /// <returns></returns>
        public static AjaxJsonValid VerifySignData(string signStr, string signData)
        {
            AjaxJsonValid ajv    = new AjaxJsonValid();
            var           md5Str = Utility.MD5(signStr + "&" + AppConfig.GetSetting("MobileInterfaceKey"));

            if (!string.IsNullOrEmpty(signData) && md5Str.ToLower() == signData.ToLower())
            {
                return(ajv);
            }
            ajv.code = (int)ApiCode.VertySignErrorCode;
            ajv.msg  = EnumHelper.GetDesc(ApiCode.VertySignErrorCode);
            return(ajv);
        }