fix:修复模板渲染器图片渲染问题
This commit is contained in:
parent
4fbe38b04a
commit
b2b9f15f79
|
@ -145,8 +145,8 @@ public class TemplateUtils {
|
||||||
String[] split = key.split("_");
|
String[] split = key.split("_");
|
||||||
if (split.length > 1 && split[1].equals("2base64Type")) {
|
if (split.length > 1 && split[1].equals("2base64Type")) {
|
||||||
int type = split.length > 2 ? Integer.parseInt(split[2]) : 1;
|
int type = split.length > 2 ? Integer.parseInt(split[2]) : 1;
|
||||||
int width = split.length > 2 ? Integer.parseInt(split[3]) : 100;
|
int width = split.length > 3 ? Integer.parseInt(split[3]) : 100;
|
||||||
int height = split.length > 3 ? Integer.parseInt(split[4]) : 100;
|
int height = split.length > 4 ? Integer.parseInt(split[4]) : 100;
|
||||||
// 如果是图片类型,需要进行base64转换
|
// 如果是图片类型,需要进行base64转换
|
||||||
String base64 = this.generateQRCode(type, String.valueOf(data.get(key)), width, height);
|
String base64 = this.generateQRCode(type, String.valueOf(data.get(key)), width, height);
|
||||||
context.setVariable(split[0], "data:image/jpeg;base64," + base64);
|
context.setVariable(split[0], "data:image/jpeg;base64," + base64);
|
||||||
|
|
Loading…
Reference in New Issue