2019-07-19 19:14

private static void generateQRCodeImage(String text, int width, int height, String filePath) throws WriterException, IOException {

Hashtable hints = new Hashtable();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.MARGIN, 4);
QRCodeWriter qrCodeWriter = new QRCodeWriter();

BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height,hints);

Path path = FileSystems.getDefault().getPath(filePath);

MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
}

2019-03-23 12:12

问题解决了 采用高端口 比如3000 4000 8080 之类就行了。mac的问题。但是jetty没问题 就undertow有问题,这个不知道为什么