记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
00c8a0ee
Commit
00c8a0ee
authored
Sep 29, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
record 增加摩登
parent
e52bfa84
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
SweetWechatActionCallbackController.java
...sweet/controller/SweetWechatActionCallbackController.java
+4
-3
SubscribeHandler.java
...com/liquidnet/service/sweet/handler/SubscribeHandler.java
+0
-1
SweetWechatCallbackServiceImpl.java
...ce/sweet/service/impl/SweetWechatCallbackServiceImpl.java
+5
-2
WechatSignUtils.java
...va/com/liquidnet/service/sweet/utils/WechatSignUtils.java
+1
-1
No files found.
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetWechatActionCallbackController.java
View file @
00c8a0ee
...
...
@@ -50,6 +50,7 @@ public class SweetWechatActionCallbackController {
@ApiOperation
(
"用户动作微信回调"
)
public
String
record
(
@RequestBody
String
requestBody
,
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"signature"
)
String
signature
,
@RequestParam
(
"timestamp"
)
String
timestamp
,
@RequestParam
(
"nonce"
)
String
nonce
,
...
...
@@ -57,13 +58,13 @@ public class SweetWechatActionCallbackController {
@RequestParam
(
name
=
"encrypt_type"
,
required
=
false
)
String
encType
,
@RequestParam
(
name
=
"msg_signature"
,
required
=
false
)
String
msgSignature
)
{
log
.
info
(
"\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
log
.
info
(
"\n接收微信请求:[
type=[{}],
openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+
" timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] "
,
openid
,
signature
,
encType
,
msgSignature
,
timestamp
,
nonce
,
requestBody
);
type
,
openid
,
signature
,
encType
,
msgSignature
,
timestamp
,
nonce
,
requestBody
);
if
(!
wechatSignUtils
.
checkSignature
(
signature
,
timestamp
,
nonce
))
{
log
.
info
(
"验签未通过,非法请求,可能属于伪造的请求!"
);
return
""
;
}
return
sweetWechatCallbackService
.
record
(
requestBody
,
timestamp
,
nonce
,
encType
,
msgSignature
);
return
sweetWechatCallbackService
.
record
(
requestBody
,
t
ype
,
t
imestamp
,
nonce
,
encType
,
msgSignature
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/handler/SubscribeHandler.java
View file @
00c8a0ee
...
...
@@ -73,7 +73,6 @@ public class SubscribeHandler implements WxMpMessageHandler {
sweetWechatUser
.
setUserId
(
IDGenerator
.
nextSnowId
());
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
LocalDateTime
now
=
LocalDateTime
.
now
();
sqls
.
add
(
SqlMapping
.
get
(
"sweet_user.insert"
));
sqlsDataA
.
add
(
new
Object
[]{
sweetWechatUser
.
getUserId
(),
sweetWechatUser
.
getOpenId
(),
sweetWechatUser
.
getUnionId
(),
sweetWechatUser
.
getNickname
(),
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetWechatCallbackServiceImpl.java
View file @
00c8a0ee
...
...
@@ -53,8 +53,11 @@ public class SweetWechatCallbackServiceImpl {
return
router
;
}
public
String
record
(
String
requestBody
,
String
timestamp
,
String
nonce
,
String
encType
,
String
msgSignature
)
{
WxMpService
wxMpService
=
wechatMpConfigure
.
getWxMpService
(
1
);
public
String
record
(
String
requestBody
,
Integer
type
,
String
timestamp
,
String
nonce
,
String
encType
,
String
msgSignature
)
{
if
(
null
==
type
||
type
<=
0
)
{
type
=
1
;
}
WxMpService
wxMpService
=
wechatMpConfigure
.
getWxMpService
(
type
);
String
out
=
null
;
if
(
encType
==
null
||
encType
.
isEmpty
())
{
// 明文传输的消息
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/WechatSignUtils.java
View file @
00c8a0ee
...
...
@@ -24,7 +24,7 @@ public class WechatSignUtils {
/**
* 验证签名
*
*
验签不区分服务号 token url配置成一样
* @param signature
* @param timestamp
* @param nonce
...
...
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