Browse Source

apptoken 操作续时间的同时,续v3token

lyhzzz 2 năm trước cách đây
mục cha
commit
0713d9cf6a

+ 6 - 0
src/main/java/com/fdkankan/ucenter/interceptor/AppInterceptor.java

@@ -42,6 +42,12 @@ public class AppInterceptor implements HandlerInterceptor {
 			String redisKey = RedisKeyUtil.PREFIX_CACHE_CAMERA + username;
 			if(redisUtil.hasKey(redisKey)){
 				redisUtil.expire(redisKey,21800L);
+				String redisKey2 =  String.format(RedisKey.TOKEN_V3 , token );
+				if(redisUtil.hasKey(redisKey2)){
+					redisUtil.expire(redisKey2,21800L);
+				}else {
+					redisUtil.set(redisKey2,token,21800L);
+				}
 				return true;
 			}
 		}catch (Exception e){