fix(sso): 修复ICaptcha强制转换为CircleCaptcha调用getImage()
ICaptcha接口没有getImage()方法,需要强制转换为CircleCaptcha Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8a91713bab
commit
0d6c3e353a
@ -61,12 +61,13 @@ public class VerifyServiceImpl implements VerifyService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Map<String, String>> getCaptcha(String remoteId) {
|
public CommonResult<Map<String, String>> getCaptcha(String remoteId) {
|
||||||
String code = lineCaptcha.getCode();
|
cn.hutool.captcha.CircleCaptcha circleCaptcha = (cn.hutool.captcha.CircleCaptcha) lineCaptcha;
|
||||||
|
String code = circleCaptcha.getCode();
|
||||||
String uuid = IdUtil.fastSimpleUUID();
|
String uuid = IdUtil.fastSimpleUUID();
|
||||||
|
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
ImageIO.write(lineCaptcha.getImage(), "png", baos);
|
ImageIO.write(circleCaptcha.getImage(), "png", baos);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("生成验证码图片失败", e);
|
throw new RuntimeException("生成验证码图片失败", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user