|
|
@@ -113,7 +113,7 @@ public class WxServiceImpl implements IWxService { |
|
|
|
*/ |
|
|
|
public String getAccessToken(){ |
|
|
|
//判断accessToken是否已经过期,如果国企需要重新获取 |
|
|
|
if(accessToken == null || expiresTime <System.currentTimeMillis()){ |
|
|
|
// if(accessToken == null || expiresTime <System.currentTimeMillis()){ |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
Map<String,String> params = new HashMap<>(2); |
|
|
|
params.put("APPID",CommonConfig.appId); |
|
|
@@ -134,7 +134,7 @@ public class WxServiceImpl implements IWxService { |
|
|
|
Long expires_in = object.getLong("expires_in"); |
|
|
|
//失效时间 = 当前时间+有效期(提前一分钟,也可以不提前) |
|
|
|
expiresTime = System.currentTimeMillis() + (expires_in - 60) * 1000; |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
return accessToken; |
|
|
|
} |