From 3f951dfe4741c18d018660b8e237031fe1c905e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E8=B1=AA?= <980287353@qq.com> Date: Thu, 12 Sep 2024 14:20:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=9B=BE=E5=83=8F=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E7=9A=84=E5=A4=A7=E5=B0=8F=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E8=B6=85=E8=BF=87500x200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/tiesheng/web/pojos/dto/ImageCodeDTO.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/springboot-web/src/main/java/com/tiesheng/web/pojos/dto/ImageCodeDTO.java b/springboot-web/src/main/java/com/tiesheng/web/pojos/dto/ImageCodeDTO.java index eb6558e..6d719ba 100644 --- a/springboot-web/src/main/java/com/tiesheng/web/pojos/dto/ImageCodeDTO.java +++ b/springboot-web/src/main/java/com/tiesheng/web/pojos/dto/ImageCodeDTO.java @@ -26,6 +26,10 @@ public class ImageCodeDTO { if (height == null) { height = 62; } + + width = Math.min(width, 500); + height = Math.min(height, 200); + LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(width, height, 4, lineCount); lineCaptcha.setGenerator(new RandomGenerator("0123456789", 4));