提交 4a45d2a8 编写于 作者: wangxinxu's avatar wangxinxu

图形验证码修改

上级 922339dd
流水线 #56403 已失败 于阶段
......@@ -33,7 +33,10 @@ public class CaptchaUtil {
public static String generateUUIDText(int count) {
int pos = count < MAXSIZE ? count : MAXSIZE;
pos = pos <= 0 ? 5 : pos;
return UUID.randomUUID().toString().replace("_", "").substring(0, pos);
String uuid = UUID.randomUUID().toString().replace("_", "");
// 去除掉i 1 0 o 等难以分辨的字母
uuid = uuid.replaceAll("i","").replaceAll("I","").replaceAll("1","").replaceAll("o","").replaceAll("O","").replaceAll("0","");
return uuid.substring(0, pos);
}
public static byte[] generateImage(String text, CaptchaContext ctx) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册