Commit dfc9ab82 by WeiCong

后台验证码支持集群模式

parent 9c731c0d
......@@ -10,15 +10,14 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.api.response.NoUiVersion;
import org.sss.presentation.noui.api.response.ResultUtil;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.util.NoUiUtils;
import org.sss.presentation.noui.util.RedisUtil;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
......@@ -67,9 +66,11 @@ public class VerifyCodeCreateController {
g.drawString(code, (i * 18) + 10, 30);
codes.append(code);
}
request.getSession().setAttribute(Constants.VERIFYCODE, codes.toString());
RedisUtil.set(request.getRequestedSessionId(), codes.toString());
// request.getSession().setAttribute(Constants.VERIFYCODE, codes.toString());
ImageIO.write(bi, "JPG", response.getOutputStream());
} catch (IOException e) {
} catch (Exception e) {
log.error("绘制登陆验证码异常", e);
} finally {
if(g!=null){
......
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