|
|
|
@ -278,6 +278,7 @@ public class FileUploadUtils
|
|
|
|
|
|
|
|
|
|
public static String code(String content,String path) {
|
|
|
|
|
String picPath = "";
|
|
|
|
|
String pathFileName = "";
|
|
|
|
|
try {
|
|
|
|
|
String codeName = UUID.randomUUID().toString();// 二维码的图片名
|
|
|
|
|
String imageType = "jpg";// 图片类型
|
|
|
|
@ -288,7 +289,7 @@ public class FileUploadUtils
|
|
|
|
|
BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 400, 400, hints);
|
|
|
|
|
File file1 = new File(path, picPath);
|
|
|
|
|
MatrixToImageWriter.writeToFile(bitMatrix, imageType, file1);
|
|
|
|
|
|
|
|
|
|
pathFileName = getPathFileName(path, picPath);
|
|
|
|
|
} catch (WriterException e) {
|
|
|
|
|
logger.error("code WriterException:", e);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
@ -296,6 +297,6 @@ public class FileUploadUtils
|
|
|
|
|
logger.error("code IOException:", e);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return picPath;
|
|
|
|
|
return pathFileName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|