|
@@ -31,8 +31,10 @@ public class NoLoginController {
|
|
|
|
|
|
try {
|
|
|
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100,4,60);
|
|
|
- String code = lineCaptcha.getCode();
|
|
|
- redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,code),code,60);
|
|
|
+ while (redisUtil.hasKey(String.format(RedisKeyUtil.loginAuthCode,lineCaptcha.getCode()))){
|
|
|
+ lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100,4,60);
|
|
|
+ }
|
|
|
+ redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,lineCaptcha.getCode()),lineCaptcha.getCode(),30);
|
|
|
lineCaptcha.write(response.getOutputStream());
|
|
|
response.getOutputStream().close();
|
|
|
} catch (Exception e){
|