|
@@ -116,7 +116,7 @@ public class WxOfficeAccountClient {
|
|
|
return cachedToken;
|
|
|
}
|
|
|
//2.如果Redis中没有,则调用微信接口获取
|
|
|
- String url = "https://api.weixin.qq.com/cgi-bin/token" +
|
|
|
+ String url = "https://api.weixin.qq.com/cgi-bin/stable_token" +
|
|
|
"?grant_type=client_credential" +
|
|
|
"&appid=" + appId +
|
|
|
"&secret=" + secret;
|
|
@@ -137,7 +137,7 @@ public class WxOfficeAccountClient {
|
|
|
String accessToken = (String) map.get("access_token");
|
|
|
|
|
|
//4.写入redis,有效期7080秒
|
|
|
- stringRedisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 7080, TimeUnit.SECONDS);
|
|
|
+ stringRedisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 1800, TimeUnit.SECONDS);
|
|
|
log.info("从微信中获取 access_token 并写入Redis:{}", accessToken);
|
|
|
return accessToken;
|
|
|
} else {
|