From 778657dd6c8f52700f3642638b87c74112d38d86 Mon Sep 17 00:00:00 2001 From: Ryn Date: Tue, 15 Jul 2025 13:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=A4=9A=E8=B4=A6=E5=8F=B7=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/AbstractWxMaConfiguration.java | 13 +++++++------ .../miniapp/properties/WxMaSingleProperties.java | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/configuration/services/AbstractWxMaConfiguration.java b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/configuration/services/AbstractWxMaConfiguration.java index 27ff84763b..50d4e89608 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/configuration/services/AbstractWxMaConfiguration.java +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/configuration/services/AbstractWxMaConfiguration.java @@ -108,12 +108,12 @@ public WxMaService wxMaService(WxMaConfig wxMaConfig, WxMaMultiProperties wxMaMu return wxMaService; } - private void configApp(WxMaDefaultConfigImpl config, WxMaSingleProperties corpProperties) { - String appId = corpProperties.getAppId(); - String appSecret = corpProperties.getAppSecret(); - String token = corpProperties.getToken(); - String aesKey = corpProperties.getAesKey(); - boolean useStableAccessToken = corpProperties.isUseStableAccessToken(); + private void configApp(WxMaDefaultConfigImpl config, WxMaSingleProperties properties) { + String appId = properties.getAppId(); + String appSecret = properties.getAppSecret(); + String token = properties.getToken(); + String aesKey = properties.getAesKey(); + boolean useStableAccessToken = properties.isUseStableAccessToken(); config.setAppid(appId); config.setSecret(appSecret); @@ -123,6 +123,7 @@ private void configApp(WxMaDefaultConfigImpl config, WxMaSingleProperties corpPr if (StringUtils.isNotBlank(aesKey)) { config.setAesKey(aesKey); } + config.setMsgDataFormat(properties.getMsgDataFormat()); config.useStableAccessToken(useStableAccessToken); } diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaSingleProperties.java b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaSingleProperties.java index 2842a2d970..57c0bfb30a 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaSingleProperties.java +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaSingleProperties.java @@ -33,6 +33,11 @@ public class WxMaSingleProperties implements Serializable { */ private String aesKey; + /** + * 消息格式,XML或者JSON. + */ + private String msgDataFormat; + /** * 是否使用稳定版 Access Token */