设备二维码存放内容修改
This commit is contained in:
parent
51caf11519
commit
68a8fe80e0
@ -31,10 +31,13 @@ public class GenerateQRCodeImage {
|
||||
public static String generateQRCodeUrl(String deviceName, String deviceCode, String companyName){
|
||||
try {
|
||||
// 二维码内容
|
||||
String qrCodeContent =deviceCode;
|
||||
Map<String,Object> qrCodeContent=new HashMap<>();
|
||||
qrCodeContent.put("deviceName",deviceName);
|
||||
qrCodeContent.put("deviceCode",deviceCode);
|
||||
String qrCodeContentStr=JSONUtil.toJsonStr(qrCodeContent);
|
||||
|
||||
// 生成二维码
|
||||
BitMatrix bitMatrix = generateQRCode(qrCodeContent, 220, 220);
|
||||
BitMatrix bitMatrix = generateQRCode(qrCodeContentStr, 220, 220);
|
||||
|
||||
// 将二维码转换为BufferedImage
|
||||
BufferedImage qrCodeImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
||||
|
Loading…
x
Reference in New Issue
Block a user