Update ImageCaptchaEndpoint.java

This commit is contained in:
shimingxy 2025-02-10 10:24:06 +08:00
parent 9218896f08
commit 397cd6fa5a

View File

@ -65,6 +65,8 @@ public class ImageCaptchaEndpoint {
String kaptchaText = captchaProducer.createText(); String kaptchaText = captchaProducer.createText();
String kaptchaValue = kaptchaText; String kaptchaValue = kaptchaText;
if (captchaType.equalsIgnoreCase("Arithmetic")) { if (captchaType.equalsIgnoreCase("Arithmetic")) {
//去除0增加计算复杂度
kaptchaText = kaptchaText.replace("0", "");
Integer minuend = Integer.valueOf(kaptchaText.substring(0, 1)); Integer minuend = Integer.valueOf(kaptchaText.substring(0, 1));
Integer subtrahend = Integer.valueOf(kaptchaText.substring(1, 2)); Integer subtrahend = Integer.valueOf(kaptchaText.substring(1, 2));
if (minuend - subtrahend > 0) { if (minuend - subtrahend > 0) {