Skip to content

Commit 14c82c1

Browse files
committed
Merge branch 'develop'
2 parents a1b72bd + 871a346 commit 14c82c1

38 files changed

+1779
-91
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ weixin-java-tools
1717
<dependency>
1818
<groupId>me.chanjar</groupId>
1919
<artifactId>weixin-java-mp</artifactId>
20-
<version>1.1.8</version>
20+
<version>1.2.0</version>
2121
</dependency>
2222
```
2323

@@ -27,7 +27,7 @@ weixin-java-tools
2727
<dependency>
2828
<groupId>me.chanjar</groupId>
2929
<artifactId>weixin-java-cp</artifactId>
30-
<version>1.1.8</version>
30+
<version>1.2.0</version>
3131
</dependency>
3232
```
3333

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>me.chanjar</groupId>
77
<artifactId>weixin-java-parent</artifactId>
8-
<version>1.1.8</version>
8+
<version>1.2.0</version>
99
<packaging>pom</packaging>
1010
<name>WeiXin Java Tools - Parent</name>
1111
<description>微信公众号、企业号上级POM</description>

weixin-java-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>me.chanjar</groupId>
88
<artifactId>weixin-java-parent</artifactId>
9-
<version>1.1.8</version>
9+
<version>1.2.0</version>
1010
</parent>
1111

1212
<artifactId>weixin-java-common</artifactId>

weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,11 @@ public class WxConsts {
137137
/** 弹出授权页面,可通过openid拿到昵称、性别、所在地。并且,即使在未关注的情况下,只要用户授权,也能获取其信息 */
138138
public static final String OAUTH2_SCOPE_USER_INFO = "snsapi_userinfo";
139139

140+
///////////////////////
141+
// 永久素材类型
142+
///////////////////////
143+
public static final String MATERIAL_NEWS = "news";
144+
public static final String MATERIAL_VOICE = "voice";
145+
public static final String MATERIAL_IMAGE = "image";
146+
public static final String MATERIAL_VIDEO = "video";
140147
}

weixin-java-cp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>me.chanjar</groupId>
88
<artifactId>weixin-java-parent</artifactId>
9-
<version>1.1.8</version>
9+
<version>1.2.0</version>
1010
</parent>
1111

1212
<artifactId>weixin-java-cp</artifactId>

weixin-java-mp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>me.chanjar</groupId>
88
<artifactId>weixin-java-parent</artifactId>
9-
<version>1.1.8</version>
9+
<version>1.2.0</version>
1010
</parent>
1111
<artifactId>weixin-java-mp</artifactId>
1212
<name>WeiXin Java Tools - MP</name>

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouterRule.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,21 @@ public WxMpMessageRouter next() {
204204
return end();
205205
}
206206

207+
/**
208+
* 将微信自定义的事件修正为不区分大小写,
209+
* 比如框架定义的事件常量为click,但微信传递过来的却是CLICK
210+
* @param wxMessage
211+
* @return
212+
*/
207213
protected boolean test(WxMpXmlMessage wxMessage) {
208214
return
209215
(this.fromUser == null || this.fromUser.equals(wxMessage.getFromUserName()))
210216
&&
211-
(this.msgType == null || this.msgType.equals(wxMessage.getMsgType()))
217+
(this.msgType == null || this.msgType.toLowerCase().equals((wxMessage.getMsgType()==null?null:wxMessage.getMsgType().toLowerCase())))
212218
&&
213-
(this.event == null || this.event.equals(wxMessage.getEvent()))
219+
(this.event == null || this.event.toLowerCase().equals((wxMessage.getEvent()==null?null:wxMessage.getEvent().toLowerCase())))
214220
&&
215-
(this.eventKey == null || this.eventKey.equals(wxMessage.getEventKey()))
221+
(this.eventKey == null || this.eventKey.toLowerCase().equals((wxMessage.getEventKey()==null?null:wxMessage.getEventKey().toLowerCase())))
216222
&&
217223
(this.content == null || this.content
218224
.equals(wxMessage.getContent() == null ? null : wxMessage.getContent().trim()))

0 commit comments

Comments
 (0)