Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
push-message
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
liucheng
push-message
Commits
3fa86144
Commit
3fa86144
authored
May 12, 2023
by
liuyiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决复杂参数的签名不一致问题
parent
542e793e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
15 deletions
+23
-15
pom.xml
pom.xml
+1
-1
CommonUtil.java
src/main/java/com/weface/common/utils/CommonUtil.java
+9
-1
GeTuiPush.java
src/main/java/com/weface/component/GeTuiPush.java
+12
-12
FilterConfig.java
src/main/java/com/weface/config/FilterConfig.java
+1
-1
No files found.
pom.xml
View file @
3fa86144
...
...
@@ -30,7 +30,7 @@
<joda.time.version>
2.9.9
</joda.time.version>
<gson.version>
2.8.5
</gson.version>
<fastjson.version>
1.2.72
</fastjson.version>
<hutool.version>
4.6.8
</hutool.version>
<hutool.version>
5.7.3
</hutool.version>
<gexin.version>
4.1.1.4
</gexin.version>
<lombok.version>
1.18.12
</lombok.version>
<easypoi.version>
4.1.0
</easypoi.version>
...
...
src/main/java/com/weface/common/utils/CommonUtil.java
View file @
3fa86144
...
...
@@ -166,7 +166,15 @@ public class CommonUtil {
builder
.
append
(
sk
);
map
.
forEach
((
k
,
v
)
->
{
if
(
v
!=
null
&&
!
"null"
.
equals
(
v
)
&&
!
""
.
equals
(
v
))
{
builder
.
append
(
v
);
String
value
=
""
;
if
(
v
instanceof
Object
[])
{
value
=
Arrays
.
toString
((
Object
[])
v
);
}
else
if
(
v
instanceof
Collection
)
{
value
=
JSONUtil
.
toJsonStr
(
v
);
}
else
{
value
=
v
.
toString
();
}
builder
.
append
(
value
);
}
});
builder
.
append
(
sk
);
...
...
src/main/java/com/weface/component/GeTuiPush.java
View file @
3fa86144
...
...
@@ -57,7 +57,7 @@ public class GeTuiPush {
String
msg
=
"测试"
;
param
.
put
(
"audience"
,
JSONUtil
.
parse
FromMap
(
audience
));
param
.
put
(
"audience"
,
JSONUtil
.
parse
(
audience
));
param
.
put
(
"settings"
,
setSetting
());
param
.
put
(
"push_message"
,
setMessage
(
msg
));
param
.
put
(
"push_channel"
,
setChannel
(
msg
));
...
...
@@ -83,7 +83,7 @@ public class GeTuiPush {
String
msg
=
"测试"
;
param
.
put
(
"audience"
,
JSONUtil
.
parse
FromMap
(
audience
));
param
.
put
(
"audience"
,
JSONUtil
.
parse
(
audience
));
param
.
put
(
"settings"
,
setSetting
());
param
.
put
(
"push_message"
,
setMessage
(
msg
));
param
.
put
(
"push_channel"
,
setChannel
(
msg
));
...
...
@@ -107,8 +107,8 @@ public class GeTuiPush {
strategy
.
put
(
"ios"
,
4
);
strategy
.
put
(
"st"
,
4
);
settings
.
put
(
"strategy"
,
JSONUtil
.
parse
FromMap
(
strategy
));
return
JSONUtil
.
parse
FromMap
(
settings
);
settings
.
put
(
"strategy"
,
JSONUtil
.
parse
(
strategy
));
return
JSONUtil
.
parse
Obj
(
settings
);
}
// 定义消息
...
...
@@ -121,7 +121,7 @@ public class GeTuiPush {
notification
.
put
(
"channel_level"
,
4
);
message
.
put
(
"notification"
,
notification
);
// message.put("transmission",msg);
return
JSONUtil
.
parse
FromMap
(
message
);
return
JSONUtil
.
parse
Obj
(
message
);
}
public
JSONObject
setChannel
(
String
msg
)
{
...
...
@@ -132,11 +132,11 @@ public class GeTuiPush {
Map
<
String
,
Object
>
alert
=
new
HashMap
<>();
alert
.
put
(
"title"
,
"ios标题"
);
alert
.
put
(
"body"
,
"ios内容"
);
aps
.
put
(
"alert"
,
JSONUtil
.
parse
FromMap
(
alert
));
aps
.
put
(
"alert"
,
JSONUtil
.
parse
(
alert
));
ios
.
put
(
"type"
,
"notify"
);
ios
.
put
(
"payload"
,
msg
);
ios
.
put
(
"aps"
,
JSONUtil
.
parse
FromMap
(
aps
));
channel
.
put
(
"ios"
,
JSONUtil
.
parse
FromMap
(
ios
));
ios
.
put
(
"aps"
,
JSONUtil
.
parse
(
aps
));
channel
.
put
(
"ios"
,
JSONUtil
.
parse
(
ios
));
Map
<
String
,
Object
>
android
=
new
HashMap
<>();
Map
<
String
,
Object
>
ups
=
new
HashMap
<>();
...
...
@@ -145,10 +145,10 @@ public class GeTuiPush {
notification
.
put
(
"body"
,
"android内容"
);
notification
.
put
(
"click_type"
,
"none"
);
ups
.
put
(
"notification"
,
JSONUtil
.
parse
FromMap
(
notification
));
android
.
put
(
"ups"
,
JSONUtil
.
parse
FromMap
(
ups
));
channel
.
put
(
"android"
,
JSONUtil
.
parse
FromMap
(
android
));
return
JSONUtil
.
parse
FromMap
(
channel
);
ups
.
put
(
"notification"
,
JSONUtil
.
parse
(
notification
));
android
.
put
(
"ups"
,
JSONUtil
.
parse
(
ups
));
channel
.
put
(
"android"
,
JSONUtil
.
parse
(
android
));
return
JSONUtil
.
parse
Obj
(
channel
);
}
public
String
getSHA256
(
String
str
)
{
...
...
src/main/java/com/weface/config/FilterConfig.java
View file @
3fa86144
...
...
@@ -33,7 +33,7 @@ public class FilterConfig {
*/
@Bean
public
FilterRegistrationBean
<
SignValidateFilter
>
signValidateFilter
()
{
final
String
include
=
"/push/single/alias,/push/single/cid"
;
final
String
include
=
"/push/single/alias,/push/single/cid
,/push/batch/alias
"
;
//不拦截的url列表
final
String
excludes
=
""
;
//拦截url列表
...
...
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