From a3cff27af838331de6a3971f4942664d584c2095 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 21 Jun 2022 17:20:29 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#2705=20=E3=80=90=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E3=80=91=E5=BC=82=E6=AD=A5=E5=AE=89=E5=85=A8=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BA=8B=E4=BB=B6=E4=B8=AD=E6=B6=88=E6=81=AF=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=88=A4=E6=96=AD=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/me/chanjar/weixin/common/api/WxConsts.java | 4 ++++ .../cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java index 35a201edb0..27b12a9258 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java @@ -287,6 +287,10 @@ public static class EventType { */ public static final String CARD_USER_GIFTING_CARD = "user_gifting_card"; + /** + * 异步安全校验事件 + */ + public static final String WXA_MEDIA_CHECK = "wxa_media_check"; /** * 卡券事件:用户核销卡券 diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java index a5f714edd0..a73f26af7c 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java @@ -183,6 +183,10 @@ private boolean isMsgDuplicated(WxMaMessage wxMessage) { messageId.append("-").append(wxMessage.getToUser()); } + if (StringUtils.isNotEmpty(wxMessage.getTraceId())) { + messageId.append("-").append(wxMessage.getTraceId()); + } + return this.messageDuplicateChecker.isDuplicate(messageId.toString()); }