From 0375fd319c9f3b08d255c814cb0f8521d8ec641b Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期三, 18 八月 2021 11:11:24 +0800 Subject: [PATCH] !78 同步dev分支 Merge pull request !78 from 疯狂的狮子Li/dev --- ruoyi-framework/src/main/java/com/ruoyi/framework/captcha/UnsignedMathGenerator.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/captcha/UnsignedMathGenerator.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/captcha/UnsignedMathGenerator.java index b4f8bfc..f35afdf 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/captcha/UnsignedMathGenerator.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/captcha/UnsignedMathGenerator.java @@ -4,7 +4,7 @@ import cn.hutool.core.math.Calculator; import cn.hutool.core.util.CharUtil; import cn.hutool.core.util.RandomUtil; -import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.utils.StringUtils; /** * 鏃犵鍙疯绠楃敓鎴愬櫒 @@ -45,8 +45,8 @@ int max = RandomUtil.randomInt(min, limit); String number1 = Integer.toString(max); String number2 = Integer.toString(min); - number1 = StrUtil.padAfter(number1, this.numberLength, CharUtil.SPACE); - number2 = StrUtil.padAfter(number2, this.numberLength, CharUtil.SPACE); + number1 = StringUtils.rightPad(number1, this.numberLength, CharUtil.SPACE); + number2 = StringUtils.rightPad(number2, this.numberLength, CharUtil.SPACE); return number1 + RandomUtil.randomChar(operators) + number2 + '='; } @@ -80,6 +80,6 @@ * @return 鏈�澶у�� */ private int getLimit() { - return Integer.parseInt("1" + StrUtil.repeat('0', this.numberLength)); + return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength)); } } -- Gitblit v1.9.3