From 74b00e90b7f27ffffb1dbd15b92cd57e99b2ba6b Mon Sep 17 00:00:00 2001 From: saint15 <1179307527@qq.com> Date: Sun, 4 Sep 2022 14:23:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E4=BD=BF=E7=94=A8Random=E5=AF=BC=E8=87=B4if=20else?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E5=87=BA=E7=8E=B0=E7=9A=84=E6=97=A0=E6=95=88?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/gateway/config/KaptchaTextCreator.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java index ea65aef7..179c2c86 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java @@ -45,7 +45,7 @@ public class KaptchaTextCreator extends DefaultTextCreator suChinese.append(CNUMBERS[y]); } } - else if (randomoperands == 2) + else { if (x >= y) { @@ -62,13 +62,6 @@ public class KaptchaTextCreator extends DefaultTextCreator suChinese.append(CNUMBERS[x]); } } - else - { - result = x + y; - suChinese.append(CNUMBERS[x]); - suChinese.append("+"); - suChinese.append(CNUMBERS[y]); - } suChinese.append("=?@" + result); return suChinese.toString(); } From 23ab45bceccea73269604c65582ffe747b5736f3 Mon Sep 17 00:00:00 2001 From: saint15 <1179307527@qq.com> Date: Sun, 4 Sep 2022 15:33:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E4=BD=BF=E7=94=A8Random=E5=AF=BC=E8=87=B4if?= =?UTF-8?q?=20else=E8=AF=AD=E5=8F=A5=E5=87=BA=E7=8E=B0=E7=9A=84=E6=97=A0?= =?UTF-8?q?=E6=95=88=E4=BB=A3=E7=A0=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74b00e90b7f27ffffb1dbd15b92cd57e99b2ba6b. --- .../com/ruoyi/gateway/config/KaptchaTextCreator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java index 179c2c86..ea65aef7 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/KaptchaTextCreator.java @@ -45,7 +45,7 @@ public class KaptchaTextCreator extends DefaultTextCreator suChinese.append(CNUMBERS[y]); } } - else + else if (randomoperands == 2) { if (x >= y) { @@ -62,6 +62,13 @@ public class KaptchaTextCreator extends DefaultTextCreator suChinese.append(CNUMBERS[x]); } } + else + { + result = x + y; + suChinese.append(CNUMBERS[x]); + suChinese.append("+"); + suChinese.append(CNUMBERS[y]); + } suChinese.append("=?@" + result); return suChinese.toString(); }