Пример #1
0
 /// <summary>
 /// 接入
 /// </summary>
 /// <param name="signature"></param>
 /// <param name="timestamp"></param>
 /// <param name="nonce"></param>
 /// <param name="echostr"></param>
 /// <returns></returns>
 public HttpResponseMessage get(string signature, string timestamp, string nonce, string echostr)
 {
     try
     {
         LogHelper.Info(this, string.Format("signature:{0},timestamp:{1},nonce:{2},echostr:{3},token:{4}", signature, timestamp, nonce, echostr, token));
         if (SignatureHandler.CheckSignature(token, signature, timestamp, nonce))
         {
             return(ToHttpMsgForWeChat(echostr));
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(this, "验证微信接口代码错误:" + ex.Message + ex.InnerException.Message);
     }
     return(ToHttpMsgForWeChat("验证失败"));
 }