Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
3c407a8f
Commit
3c407a8f
authored
Dec 13, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
638974d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
25 deletions
+14
-25
WeChatNotifyController.cs
...WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
+14
-25
No files found.
Mall.WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
View file @
3c407a8f
...
...
@@ -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
.
Write
Info
(
"nonce:"
+
ex
.
Message
);
}
try
{
...
...
@@ -585,7 +583,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch
(
Exception
ex
)
{
encrypt_type
=
""
;
LogHelper
.
Write
(
ex
,
"encrypt_type"
);
LogHelper
.
Write
Info
(
"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
.
Write
Info
(
"msg_signature"
+
ex
.
Message
);
}
try
{
...
...
@@ -603,7 +601,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
catch
(
Exception
ex
)
{
openid
=
""
;
LogHelper
.
Write
(
ex
,
"openid"
);
LogHelper
.
Write
Info
(
"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
.
Write
Info
(
"我是回调方法: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
.
Write
Info
(
"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
.
Write
Info
(
"我是返回信息:"
+
postStr
);
lock
(
_lock
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
postStr
))
...
...
@@ -671,7 +660,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
.
ToString
());
LogHelper
.
Write
Info
(
ex
.
ToString
());
}
return
echostr
??
"echostr is null"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment