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
34b584e8
Commit
34b584e8
authored
Dec 13, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
63654d6c
61769241
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
18 deletions
+60
-18
WXBizMsgCrypt.cs
Mall.Common/Pay/WeChatPat/Msg/WXBizMsgCrypt.cs
+29
-0
BuildingCarrierModule_V2.cs
Mall.Module.TradePavilion/BuildingCarrierModule_V2.cs
+6
-5
WeChatNotifyController.cs
...WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
+22
-12
AppletTradeController.cs
...WebApi/Controllers/TradePavilion/AppletTradeController.cs
+3
-1
No files found.
Mall.Common/Pay/WeChatPat/Msg/WXBizMsgCrypt.cs
View file @
34b584e8
...
...
@@ -291,5 +291,34 @@ namespace Mall.Common.Pay.WeChatPat
}
return
wx
;
}
/// <summary>
/// 验证微信签名
/// * 将token、timestamp、nonce三个参数进行字典序排序
/// * 将三个参数字符串拼接成一个字符串进行sha1加密
/// * 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信。
/// </summary>
/// <param name="signature"></param>
/// <param name="timestamp"></param>
/// <param name="nonce"></param>
/// <param name="_token"></param>
/// <returns></returns>
[
Obsolete
]
public
static
bool
CheckSignature
(
string
signature
,
string
timestamp
,
string
nonce
,
string
_token
)
{
return
false
;
//var vs = new[] { timestamp, nonce, _token }.OrderBy(s => s);
//var str = string.Join("", vs);
//var tmpStr = FormsAuthentication.HashPasswordForStoringInConfigFile(str, "SHA1");
//tmpStr = tmpStr.ToLower();
//Plugin.LogHelper.Write("tmpStr:" + tmpStr + ",_token:" + _token);
//if (tmpStr == null)
//{
// return false;
//}
//return tmpStr.Equals(signature, StringComparison.CurrentCultureIgnoreCase);
}
}
}
Mall.Module.TradePavilion/BuildingCarrierModule_V2.cs
View file @
34b584e8
...
...
@@ -892,21 +892,22 @@ namespace Mall.Module.TradePavilion
//审核通过了的 直接查询资料表
var
blist
=
buildingRepository
.
GetBuildingRepository
(
new
RB_Building_Extend
()
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
UserId
=
userId
});
model
.
buildingApplyForModel
=
blist
.
FirstOrDefault
().
RefMapperTo
<
RB_BuildingApplyFor_Extend
>();
if
(
model
.
EnterpriseServicesModel
!=
null
)
model
.
buildingApplyForModel
.
ID
=
blist
.
FirstOrDefault
().
BuildId
;
if
(
model
.
buildingApplyForModel
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
EnterpriseServices
Model
.
Banner
))
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
buildingApplyFor
Model
.
Banner
))
{
model
.
EnterpriseServicesModel
.
BannerList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
EnterpriseServices
Model
.
Banner
);
model
.
buildingApplyForModel
.
BannerList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
buildingApplyFor
Model
.
Banner
);
}
else
{
model
.
EnterpriseServices
Model
.
BannerList
=
new
List
<
string
>();
model
.
buildingApplyFor
Model
.
BannerList
=
new
List
<
string
>();
}
}
else
{
model
.
EnterpriseServicesModel
=
new
RB_EnterpriseServicesApply
_Extend
model
.
buildingApplyForModel
=
new
RB_BuildingApplyFor
_Extend
{
BannerList
=
new
List
<
string
>(),
};
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
View file @
34b584e8
...
...
@@ -539,10 +539,13 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <returns></returns>
[
HttpPost
]
[
HttpGet
]
public
void
EventMessageCall
(
int
MallBaseId
,
int
TenantId
,
string
signature
,
string
echostr
,
string
timestamp
,
string
nonce
,
string
openid
,
string
encrypt_type
,
string
msg_signature
)
public
string
EventMessageCall
(
int
MallBaseId
,
int
TenantId
,
string
signature
,
string
echostr
,
string
timestamp
,
string
nonce
,
string
openid
,
string
encrypt_type
,
string
msg_signature
)
{
LogHelper
.
WriteInfo
(
"我进来了参数如下[MallBaseId:"
+
MallBaseId
+
",TenantId:"
+
TenantId
+
",TenantId:"
+
signature
+
",signature:"
+
signature
+
",echostr:"
+
echostr
+
",timestamp:"
+
timestamp
+
",nonce:"
+
nonce
+
",openid:"
+
openid
+
",encrypt_type:"
+
encrypt_type
+
",msg_signature:"
+
msg_signature
);
var
req
=
new
RequestHandler
();
try
{
int
qrCodeType
=
0
;
int
userId
=
0
;
string
textpl
=
""
;
...
...
@@ -551,35 +554,42 @@ namespace Mall.WebApi.Controllers.AppletWeChat
string
sAppID
=
"wxaeb077c07ed6f30d"
;
string
sEncodingAESKey
=
"9FgR0wMXxe6wXBB5hwgpn2mZM6sQMi3E3Vk5sxrXEAL"
;
var
request
=
_accessor
.
HttpContext
.
Request
;
LogHelper
.
Write
(
"我是回调方法:EventMessageCall"
+
"请求方式:"
+
request
.
Method
);
if
(
request
.
Method
==
"GET"
)
{
//WXBizMsgCrypt.CheckSignature(signature, timestamp, nonce, sToken);
}
// var inputStream = request.Body;
var
str
=
new
StreamReader
(
request
.
Body
);
string
postStr
=
str
.
ReadToEnd
();
LogHelper
.
Write
(
"我是返回信息:"
+
postStr
);
lock
(
_lock
)
{
WechatMessage
wx
=
WXBizMsgCrypt
.
GetWxMessage
(
postStr
,
timestamp
,
nonce
,
signature
,
encrypt_type
,
msg_signature
,
openid
);
if
(!
string
.
IsNullOrWhiteSpace
(
wx
.
EventKey
))
// 用户未关注时,进行关注后的事件推送;事件KEY值,qrscene_为前缀,后面为二维码的参数值
if
(!
string
.
IsNullOrWhiteSpace
(
postStr
))
{
textpl
=
ReceivedText
(
wx
.
FromUserName
,
wx
.
ToUserName
,
content
);
if
(
encrypt_type
.
ToLower
()
==
"aes"
.
ToLower
())
//加密模式需要先解密
WechatMessage
wx
=
WXBizMsgCrypt
.
GetWxMessage
(
postStr
,
timestamp
,
nonce
,
signature
,
encrypt_type
,
msg_signature
,
openid
);
if
(
!
string
.
IsNullOrWhiteSpace
(
wx
.
MsgType
))
// 用户未关注时,进行关注后的事件推送;事件KEY值,qrscene_为前缀,后面为二维码的参数值
{
var
ret
=
new
WXBizMsgCrypt
(
sToken
,
sEncodingAESKey
,
sAppID
);
int
r
=
ret
.
EncryptMsg
(
textpl
,
timestamp
,
nonce
,
ref
textpl
);
if
(
r
!=
0
)
textpl
=
ReceivedText
(
wx
.
FromUserName
,
wx
.
ToUserName
,
content
);
if
(
encrypt_type
.
ToLower
()
==
"aes"
.
ToLower
())
//加密模式需要先解密
{
LogHelper
.
WriteInfo
(
"GetWxMessage_消息加密失败:"
);
textpl
=
""
;
var
ret
=
new
WXBizMsgCrypt
(
sToken
,
sEncodingAESKey
,
sAppID
);
int
r
=
ret
.
EncryptMsg
(
textpl
,
timestamp
,
nonce
,
ref
textpl
);
if
(
r
!=
0
)
{
LogHelper
.
WriteInfo
(
"GetWxMessage_消息加密失败:"
);
textpl
=
""
;
}
}
}
}
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
.
ToString
());
}
return
echostr
??
"echostr is null"
;
}
/// <summary>
...
...
Mall.WebApi/Controllers/TradePavilion/AppletTradeController.cs
View file @
34b584e8
...
...
@@ -3483,7 +3483,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
var
userInfo
=
AppletUserInfo
;
RB_Building_Extend
query
=
JsonConvert
.
DeserializeObject
<
RB_Building_Extend
>(
RequestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ID
=
parms
.
GetInt
(
"ID"
);
query
.
BuildId
=
ID
;
if
(
query
.
BuildId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递楼宇id"
);
...
...
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