fix:图像验证码的大小不能超过500x200

This commit is contained in:
曾文豪
2024-09-12 14:20:17 +08:00
parent 9c66dafe6b
commit 3f951dfe47

View File

@@ -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));