Commit 9c5bdd14 by xiaoyj

微信token时间修改

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21860 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 3d28332a
...@@ -117,7 +117,9 @@ public class WechatUtils { ...@@ -117,7 +117,9 @@ public class WechatUtils {
JSONObject tokenJO = JSON.parseObject(result); JSONObject tokenJO = JSON.parseObject(result);
if (tokenJO.containsKey("access_token")) { if (tokenJO.containsKey("access_token")) {
access_token = tokenJO.getString("access_token"); access_token = tokenJO.getString("access_token");
long expires_in = tokenJO.getLongValue("expires_in"); //long expires_in = tokenJO.getLongValue("expires_in");
//过期时间设置为10分钟
long expires_in=600;
String tokenCacheKey = Constants.WECHAT_TOKEN_KEY + appid; String tokenCacheKey = Constants.WECHAT_TOKEN_KEY + appid;
redisCacheUtil.setCacheObject(tokenCacheKey, access_token, expires_in, TimeUnit.SECONDS); redisCacheUtil.setCacheObject(tokenCacheKey, access_token, expires_in, TimeUnit.SECONDS);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!