diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/wechat/service/impl/WxURLSchemeServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/wechat/service/impl/WxURLSchemeServiceImpl.java index 6408090b..1e4ae774 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/wechat/service/impl/WxURLSchemeServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/wechat/service/impl/WxURLSchemeServiceImpl.java @@ -52,7 +52,7 @@ public class WxURLSchemeServiceImpl implements WxURLSchemeService { public CommonResult generateCommonWxUrlScheme() { // 常量定义 final String REDIS_KEY = "rdsCommonWxUrlScheme"; - final long EXPIRE_DAYS = 30; + final long EXPIRE_DAYS = 365; // === 第一阶段:尝试从Redis获取缓存 === Object cachedScheme = redisService.get(REDIS_KEY); @@ -85,7 +85,7 @@ public class WxURLSchemeServiceImpl implements WxURLSchemeService { requestBody.put("jump_wxa", jumpWxa); requestBody.put("is_expire", true); requestBody.put("expire_type", 0); - long expireSeconds = TimeUnit.DAYS.toSeconds(EXPIRE_DAYS); // 30天有效期 + long expireSeconds = TimeUnit.DAYS.toSeconds(EXPIRE_DAYS); requestBody.put("expire_time", System.currentTimeMillis() / 1000 + expireSeconds); // === 第三阶段:调用微信API ===