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
12379576
Commit
12379576
authored
Nov 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
c5a80e61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
MessageController.cs
Mall.WebApi/Controllers/Adapay/MessageController.cs
+19
-7
No files found.
Mall.WebApi/Controllers/Adapay/MessageController.cs
View file @
12379576
...
...
@@ -19,6 +19,10 @@ namespace Mall.WebApi.Controllers.Adapay
[
EnableCors
(
"AllowCors"
)]
public
class
MessageController
:
ControllerBase
{
public
string
token
=
"jjswviitto"
;
public
string
aes
=
"leHp9tJo9shWv63PFebqWT3UR6o5OKMD9YKFrDd2yxT"
;
public
string
appId
=
"wx5349e63aea0c8529"
;
/// <summary>
/// 接口认证
/// </summary>
...
...
@@ -28,16 +32,22 @@ namespace Mall.WebApi.Controllers.Adapay
/// <param name="nonce"></param>
/// <returns></returns>
[
HttpGet
]
public
bool
CheckSignature
(
string
echostr
,
string
signature
,
string
timestamp
,
string
nonce
)
public
string
CheckSignature
(
string
echostr
,
string
signature
,
string
timestamp
,
string
nonce
)
{
string
token
=
"jjsw"
;
string
queryStr
=
string
.
Format
(
"echostr:{0} signature:{1} timestamp:{2} nonce:{3}"
,
echostr
,
signature
,
timestamp
,
nonce
);
Common
.
Plugin
.
LogHelper
.
WriteInfo
(
queryStr
);
if
(!
CheckSignatureModule
(
token
,
signature
,
timestamp
,
nonce
))
Tencent
.
WXBizMsgCrypt
wxcpt
=
new
Tencent
.
WXBizMsgCrypt
(
token
,
aes
,
appId
);
string
sVerifyMsgSig
=
signature
;
string
sVerifyTimeStamp
=
timestamp
;
string
sVerifyNonce
=
nonce
;
string
sVerifyEchoStr
=
echostr
;
string
sEchoStr
=
""
;
int
ret
=
wxcpt
.
VerifySignature
(
token
,
sVerifyTimeStamp
,
sVerifyNonce
,
sVerifyEchoStr
,
sVerifyMsgSig
);
if
(
ret
!=
0
)
{
return
false
;
Common
.
Plugin
.
LogHelper
.
Write
(
"验证Url失败:"
+
ret
)
;
}
return
true
;
return
sEchoStr
;
}
/// <summary>
...
...
@@ -80,5 +90,7 @@ namespace Mall.WebApi.Controllers.Adapay
return
false
;
}
}
}
}
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