Commit 3c407a8f authored by 黄奎's avatar 黄奎

111

parent 638974d6
......@@ -534,15 +534,14 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <summary>
///
/// 微信消息
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
public string EventMessageCall()
public string EventMessageCall(int MallBaseId,int TenantId)
{
int MallBaseId = 0;
int TenantId = 0;
LogHelper.WriteInfo("EventMessageCall_进入方法....");
string timestamp = "";
string nonce = "";
string echostr = "";
......@@ -550,7 +549,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
string encrypt_type = "";
string msg_signature = "";
string openid = "";
try
{
signature = HttpContext.Request.Query["signature"].ToString();
......@@ -558,7 +556,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
signature = "";
LogHelper.Write(ex, "signature");
LogHelper.Write("signature:" + ex.Message);
}
try
{
......@@ -566,7 +564,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
catch (Exception ex)
{
LogHelper.Write(ex, "timestamp");
LogHelper.Write("timestamp:" + ex.Message);
timestamp = "";
}
try
......@@ -576,7 +574,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
nonce = "";
LogHelper.Write(ex, "nonce");
LogHelper.WriteInfo("nonce:" + ex.Message);
}
try
{
......@@ -585,7 +583,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
encrypt_type = "";
LogHelper.Write(ex, "encrypt_type");
LogHelper.WriteInfo("encrypt_type:" + ex.Message);
}
try
{
......@@ -594,7 +592,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
msg_signature = "";
LogHelper.Write(ex, "msg_signature");
LogHelper.WriteInfo("msg_signature" + ex.Message);
}
try
{
......@@ -603,7 +601,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
openid = "";
LogHelper.Write(ex, "openid");
LogHelper.WriteInfo("openid:" + ex.Message);
}
LogHelper.WriteInfo($"我进来了参数如下[MallBaseId:" + MallBaseId+ "," +
......@@ -611,7 +609,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var req = new RequestHandler();
try
{
int qrCodeType = 0;
int userId = 0;
string textpl = "";
......@@ -621,7 +618,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
string sEncodingAESKey = "9FgR0wMXxe6wXBB5hwgpn2mZM6sQMi3E3Vk5sxrXEAL";
var request = _accessor.HttpContext.Request;
LogHelper.Write("我是回调方法:EventMessageCall" + "请求方式:" + request.Method);
LogHelper.WriteInfo("我是回调方法:EventMessageCall" + "请求方式:" + request.Method);
if (request.Method == "GET")
{
try
......@@ -631,22 +628,14 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch (Exception ex)
{
echostr = "";
LogHelper.Write(ex, "echostr" );
LogHelper.WriteInfo("echostr:::"+ ex.Message);
}
return echostr ?? "echostr is null";
//if (WXBizMsgCrypt.CheckSignature(signature, timestamp, nonce, sToken))
//{
// return echostr ?? "echostr is null";
//}
//else
//{
// return echostr ?? "echostr is null";
//}
}
// var inputStream = request.Body;
var str = new StreamReader(request.Body);
string postStr = str.ReadToEnd();
LogHelper.Write("我是返回信息:" + postStr);
LogHelper.WriteInfo("我是返回信息:" + postStr);
lock (_lock)
{
if (!string.IsNullOrWhiteSpace(postStr))
......@@ -671,7 +660,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
catch (Exception ex)
{
LogHelper.Write(ex.ToString());
LogHelper.WriteInfo(ex.ToString());
}
return echostr ?? "echostr is null";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment