From e29d5cff136dea2d91775bb8e10d28f60a27a3d4 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Wed, 27 Sep 2023 08:09:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../youlai/system/service/impl/AuthServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/youlai/system/service/impl/AuthServiceImpl.java b/src/main/java/com/youlai/system/service/impl/AuthServiceImpl.java index 6f004cf7..c2b1811d 100644 --- a/src/main/java/com/youlai/system/service/impl/AuthServiceImpl.java +++ b/src/main/java/com/youlai/system/service/impl/AuthServiceImpl.java @@ -1,6 +1,6 @@ package com.youlai.system.service.impl; -import cn.hutool.captcha.LineCaptcha; +import cn.hutool.captcha.CircleCaptcha; import cn.hutool.captcha.generator.MathGenerator; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; @@ -85,10 +85,10 @@ public class AuthServiceImpl implements AuthService { public CaptchaResult getCaptcha() { MathGenerator mathGenerator=new MathGenerator(1); - LineCaptcha lineCaptcha =new LineCaptcha(480,120,4,20); - lineCaptcha.setGenerator(mathGenerator); - String captchaCode = lineCaptcha.getCode(); // 验证码 - String captchaBase64 = lineCaptcha.getImageBase64Data(); // 验证码图片Base64 + CircleCaptcha circleCaptcha =new CircleCaptcha(150,25,4,3); + circleCaptcha.setGenerator(mathGenerator); + String captchaCode = circleCaptcha.getCode(); // 验证码 + String captchaBase64 = circleCaptcha.getImageBase64Data(); // 验证码图片Base64 // 验证码文本缓存至Redis,用于登录校验 String verifyCodeKey = IdUtil.fastSimpleUUID();