增加中文验证码功能

This commit is contained in:
synchronized
2018-07-28 00:22:49 +08:00
parent fda509dfe3
commit eeb7045f4d
9 changed files with 406 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ public abstract class Captcha extends Randoms {
protected int len = 5; // 验证码随机字符长度
protected int width = 130; // 验证码显示宽度
protected int height = 48; // 验证码显示高度
private String chars = null; // 当前验证码
protected String chars = null; // 当前验证码
protected int charType = TYPE_DEFAULT; // 验证码类型1字母数字混合2纯数字3纯字母
public static final int TYPE_DEFAULT = 1; // 字母数字混合
public static final int TYPE_ONLY_NUMBER = 2; // 纯数字
@@ -25,8 +25,6 @@ public abstract class Captcha extends Randoms {
* @return 验证码字符数组
*/
protected char[] alphas() {
"".toLowerCase();
"".toUpperCase();
char[] cs = new char[len];
for (int i = 0; i < len; i++) {
switch (charType) {