Commit db25fb7f by 吕明尚

修改微信公众号发送模板消息接口

parent c9c1bc98
......@@ -530,7 +530,12 @@ public class WechatNewServiceImpl implements WechatNewService {
}
} else if (data.getString("errcode").equals("40014") || data.getString("errcode").equals("40001")) {
getPublicAccessToken();
String appId = officialAccountConfig.getAppId();
String secret = officialAccountConfig.getAppSecret();
WeChatAccessTokenVo accessTokenVo = getAccessToken(appId, secret, "public");
// 缓存accessToken
redisUtil.set(WeChatConstants.REDIS_WECAHT_PUBLIC_ACCESS_TOKEN_KEY, accessTokenVo.getAccessToken(),
accessTokenVo.getExpiresIn().longValue() - 1800L, TimeUnit.SECONDS);
return sendPublicTemplateMessage(templateMessage);
}
return Boolean.TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment