Revert "删除验证码使用Random导致if else语句出现的无效代码"

This reverts commit 74b00e90b7.
This commit is contained in:
saint15 2022-09-04 15:33:31 +08:00
parent 74b00e90b7
commit 23ab45bcec
1 changed files with 8 additions and 1 deletions

View File

@ -45,7 +45,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
suChinese.append(CNUMBERS[y]); suChinese.append(CNUMBERS[y]);
} }
} }
else else if (randomoperands == 2)
{ {
if (x >= y) if (x >= y)
{ {
@ -62,6 +62,13 @@ public class KaptchaTextCreator extends DefaultTextCreator
suChinese.append(CNUMBERS[x]); suChinese.append(CNUMBERS[x]);
} }
} }
else
{
result = x + y;
suChinese.append(CNUMBERS[x]);
suChinese.append("+");
suChinese.append(CNUMBERS[y]);
}
suChinese.append("=?@" + result); suChinese.append("=?@" + result);
return suChinese.toString(); return suChinese.toString();
} }