java 生成二维码
每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code
1. POM引入
<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.1</version>
</dependency>
2.逻辑
// 审核通过时生成二维码图片
String url = platformPath + "/appinfo/" + entity.getId();
try
{
String imgPath = QRCodeUtil.encode(url,"","/tmp/"+entity.getId()+".jpg",true);
logger.info("生成二维码图片地址------" + imgPath);
}
catch (Exception e)
{
logger.error("审核应用通过,生成二维码报错", e);
}
每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code
编程PDF电子书免费下载: http://www.shitanlife.com/code 每天学习一点点