生成base64位格式的图形验证码
/**
* 生成base64位格式的验证码
* @return
*/
@Override
public String GetBase64GraphicCode(Base64GraphicCodeDTO base64GraphicCodeDTO) {
//生成 线段干扰的验证码 lineCount越大,图形背景越模糊
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(300, 192, 5, 1000);
//拿到5位code
String code = lineCaptcha.getCode();
//todo 存入redis
//将验证码图片转换为base64格式字符串
String imageBase64 = lineCaptcha.getImageBase64();
return imageBase64;
}