Merge pull request #985 from juzi214032/feat/captcha/base64

feat(captcha): 新增获取验证码带文件格式的 Base64 编码
This commit is contained in:
Golden Looly 2020-07-25 18:06:38 +08:00 committed by GitHub
commit 403c2b1f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,6 +194,15 @@ public abstract class AbstractCaptcha implements ICaptcha {
return Base64.encode(getImageBytes()); return Base64.encode(getImageBytes());
} }
/**
* 获取图片带文件格式的 Base64
*
* @return 图片带文件格式的 Base64
*/
public String getImageBase64Full(){
return "data:image/png;base64," + Base64.encode(getImageBytes());
}
/** /**
* 自定义字体 * 自定义字体
* *