From 9e78a943c2b6b3a345d0bd1270b7bc25caf8a7e3 Mon Sep 17 00:00:00 2001 From: wzp Date: Tue, 24 Dec 2024 17:01:24 +0800 Subject: [PATCH] feat: change the verify code image size to 120x40 --- src/main/java/org/blue/club/utils/VerifyCodeUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/blue/club/utils/VerifyCodeUtils.java b/src/main/java/org/blue/club/utils/VerifyCodeUtils.java index a18b749..66f3432 100644 --- a/src/main/java/org/blue/club/utils/VerifyCodeUtils.java +++ b/src/main/java/org/blue/club/utils/VerifyCodeUtils.java @@ -20,9 +20,9 @@ import java.util.Random; @Component @RequiredArgsConstructor public class VerifyCodeUtils { - public static final int width = 240; - public static final int height = 80; - public static final int fontSize = 50; + public static final int width = 120; + public static final int height = 40; + public static final int fontSize = 25; public static final Font mainFont = new Font("宋体", Font.BOLD, fontSize); private final RandomUtils randomUtils; @@ -43,7 +43,7 @@ public class VerifyCodeUtils { for (char c : text.toCharArray()) { Random random = new Random(); setToRandomColor(g); - g.drawString(c + "", 15 + x * 40, 40 + new Random().nextInt(10)); + g.drawString(c + "", 15 + x * 20, 20 + new Random().nextInt(10)); for (int j = 0; j < random.nextInt(3, 7); j++) { setToRandomColor(g); g.drawLine(random.nextInt(width), random.nextInt(height), random.nextInt(width), random.nextInt(height));