fix(sso): 修复验证码每次返回相同图片的问题

每次调用createCode()重新生成验证码

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
liulujian 2026-04-15 16:33:30 +08:00
parent 48d5f46c17
commit 24374d72fe

View File

@ -63,6 +63,8 @@ public class VerifyServiceImpl implements VerifyService {
@Override @Override
public CommonResult<Map<String, String>> getCaptcha(String remoteId) { public CommonResult<Map<String, String>> getCaptcha(String remoteId) {
cn.hutool.captcha.CircleCaptcha circleCaptcha = (cn.hutool.captcha.CircleCaptcha) lineCaptcha; cn.hutool.captcha.CircleCaptcha circleCaptcha = (cn.hutool.captcha.CircleCaptcha) lineCaptcha;
// 重新生成验证码否则返回的总是相同的图片
circleCaptcha.createCode();
String code = circleCaptcha.getCode(); String code = circleCaptcha.getCode();
String uuid = IdUtil.fastSimpleUUID(); String uuid = IdUtil.fastSimpleUUID();