🎨 #3261【公众号】增加是否启用 StableAccessToken的配置

This commit is contained in:
foreveryang321
2024-05-09 00:24:59 +08:00
committed by GitHub
parent 976b2b5a17
commit 767fdd5289
6 changed files with 28 additions and 15 deletions

View File

@ -19,12 +19,14 @@
## 选填
wx.mp.tenantId1.token=@token
wx.mp.tenantId1.aes-key=@aesKey
wx.mp.tenantId1.use-stable-access-token=@useStableAccessToken
## 应用 2 配置(必填)
wx.mp.tenantId2.app-id=@appId
wx.mp.tenantId2.app-secret =@secret
## 选填
wx.mp.tenantId2.token=@token
wx.mp.tenantId2.aes-key=@aesKey
wx.mp.tenantId2.use-stable-access-token=@useStableAccessToken
# ConfigStorage 配置(选填)
## 配置类型: memory(默认), jedis, redisson, redis_template

View File

@ -115,6 +115,7 @@ public abstract class AbstractWxMpConfiguration {
String appSecret = corpProperties.getAppSecret();
String token = corpProperties.getToken();
String aesKey = corpProperties.getAesKey();
boolean useStableAccessToken = corpProperties.isUseStableAccessToken();
config.setAppId(appId);
config.setSecret(appSecret);
@ -124,6 +125,7 @@ public abstract class AbstractWxMpConfiguration {
if (StringUtils.isNotBlank(aesKey)) {
config.setAesKey(aesKey);
}
config.setUseStableAccessToken(useStableAccessToken);
}
private void configHttp(WxMpDefaultConfigImpl config, WxMpMultiProperties.ConfigStorage storage) {

View File

@ -32,4 +32,9 @@ public class WxMpSingleProperties implements Serializable {
* 设置微信公众号的 EncodingAESKey.
*/
private String aesKey;
/**
* 是否使用稳定版 Access Token
*/
private boolean useStableAccessToken = false;
}