Commit 7e12af4d authored by litengwei's avatar litengwei

设备平台登陆失效问题

parent 813058a3
...@@ -30,6 +30,8 @@ import org.springframework.util.ObjectUtils; ...@@ -30,6 +30,8 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -86,7 +88,12 @@ public class LoginController { ...@@ -86,7 +88,12 @@ public class LoginController {
reginParams = getLogin(userId, token); reginParams = getLogin(userId, token);
}else{ }else{
RequestContext.setProduct(product); RequestContext.setProduct(product);
if (!TokenOperation.refresh(reginParams.getToken())) { String cacheKey = Redis.genKey(new String[]{CacheType.ERASABLE.name(), "SESSION_TOKEN", RequestContext.getProduct(), reginParams.getToken()});
boolean hasKey = Redis.getRedisTemplate().hasKey(cacheKey);
if (hasKey) {
return reginParams;
} else {
logger.info("Auto自动登陆=====:{}", JSON.toJSONString(reginParams));
reginParams = getLogin(userId, token); reginParams = getLogin(userId, token);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment