Commit bb18eaaf by WeiCong

调整登陆验证码生成

parent 61e3e41f
......@@ -29,7 +29,7 @@ public class VerifyCodeCreateController {
final static String STR = "QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";
private static final Log log = LogFactory.getLog(VerifyCodeCreateController.class);
private static final int width = 100;//验证码图片宽度
private static final int height = 50;//验证码图片高度
private static final int height = 40;//验证码图片高度
private static final int vcsessionout = 120;//验证码超时时间
final float yawpRate = 0.05f;// 噪声率
final int area = (int) (yawpRate * width * height);
......@@ -84,7 +84,8 @@ public class VerifyCodeCreateController {
g.setColor(new Color(r.nextInt(88), r.nextInt(188), r.nextInt(255)));
Font font = new Font("Times New Roman", Font.ITALIC, fontSize);
g.setFont(font);
g.drawString(code, (i * 18) + 10, 30);
float x = i * 1.0F * width / 4;
g.drawString(code, x, height - 5);
codes.append(code);
}
StringBuilder key = new StringBuilder(codes);
......
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