Commit 3d9c37d5 by 徐高华

登录缓存

parent 12092eb2
......@@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.servlet.http.Cookie;
......@@ -196,6 +197,13 @@ public class LoginController extends WebBaseController {
ModelAndView model = new ModelAndView(new RedirectView("/haoban-3/#/gic-error", false, false));
return model;
}
Object flag = RedisUtil.getCache(random);
if(null == flag) {
logger.info("无缓存");
ModelAndView model = new ModelAndView(
new RedirectView("/haoban-3/#/gic-error?errorCode=1005", false, false));
return model;
}
JSONObject jsonObject = JSONObject.parseObject(o);
logger.info("登录信息={}",jsonObject.toString());
String gicEnterpriseId = jsonObject.getString("enterpriseId");
......@@ -235,6 +243,7 @@ public class LoginController extends WebBaseController {
new RedirectView("/haoban-3/#/gic-error?errorCode=" + errorCode, false, false));
return model;
}
RedisUtil.delCache(random) ;
return null;
}
......@@ -522,6 +531,7 @@ public class LoginController extends WebBaseController {
String ret = JSONObject.toJSONString(retMap);
AES aes = SecureUtil.aes(LOGIN_KEY.getBytes());
String random = aes.encryptHex(ret);
RedisUtil.setCache(random, 1,10L,TimeUnit.MINUTES);
ModelAndView model = new ModelAndView(new RedirectView("/haoban-3/#/loginMore?random=" + random, false, false));
return model;
}
......
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