From fd60ff265d390362152dbd95558a151a9468a8a8 Mon Sep 17 00:00:00 2001 From: Radix10 Date: Sun, 3 Dec 2017 08:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=8F=E6=9C=BA=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20=E4=BD=BF=E7=94=A8new=20Random(Sy?= =?UTF-8?q?stem.currentTimeMillis())=E6=97=B6=E9=97=B4=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E4=BC=9A=E4=BA=A7=E7=94=9F=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E3=80=82=20rand.nextInt(codesLen=20?= =?UTF-8?q?-=201)=E4=B8=8D=E4=BC=9A=E4=BA=A7=E7=94=9F=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AD=97=E7=AC=A6=E7=9A=84=E5=81=8F=E7=A7=BB?= =?UTF-8?q?=E9=87=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/binux/sso/utils/VerifyCodeUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbin-store-web-sso/src/main/java/cn/binux/sso/utils/VerifyCodeUtils.java b/xbin-store-web-sso/src/main/java/cn/binux/sso/utils/VerifyCodeUtils.java index b436256..89290aa 100644 --- a/xbin-store-web-sso/src/main/java/cn/binux/sso/utils/VerifyCodeUtils.java +++ b/xbin-store-web-sso/src/main/java/cn/binux/sso/utils/VerifyCodeUtils.java @@ -46,10 +46,10 @@ public class VerifyCodeUtils { sources = VERIFY_CODES; } int codesLen = sources.length(); - Random rand = new Random(System.currentTimeMillis()); + Random rand = new Random(); StringBuilder verifyCode = new StringBuilder(verifySize); for (int i = 0; i < verifySize; i++) { - verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1))); + verifyCode.append(sources.charAt(rand.nextInt(codesLen))); } return verifyCode.toString(); } -- Gitee