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

111

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