|
@@ -48,11 +48,13 @@ public class NoLoginController {
|
|
|
public void getLoginCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
|
response.setHeader("Cache-Control", "no-store, no-cache");
|
|
|
response.setContentType("image/jpeg");
|
|
|
- String id = request.getSession().getId();
|
|
|
+ String id ;
|
|
|
try {
|
|
|
LineCaptcha lineCaptcha = new LineCaptcha(200, 100);
|
|
|
RandomGenerator mathGenerator = new RandomGenerator("1234567890",4);
|
|
|
lineCaptcha.setGenerator(mathGenerator);
|
|
|
+ //id = request.getSession().getId();
|
|
|
+ id = lineCaptcha.getCode();
|
|
|
redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,id),lineCaptcha.getCode(),60*5);
|
|
|
lineCaptcha.write(response.getOutputStream());
|
|
|
response.getOutputStream().close();
|