|
|
@ -80,7 +80,7 @@ public class QRCodeUtil { |
|
|
|
public static String createCodeToFile(String content) { |
|
|
|
public static String createCodeToFile(String content) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
String imgPath = CommonConstant.SYSTEMFILEPATH; |
|
|
|
String imgPath = CommonConstant.SYSTEMFILEPATH+"qrCodeImg/"; |
|
|
|
File codeImgFileSaveDir = new File(imgPath); |
|
|
|
File codeImgFileSaveDir = new File(imgPath); |
|
|
|
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
|
|
|
|
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
|
|
|
|
String fileName = UUID.randomUUID() + "." +FileFormat; |
|
|
|
String fileName = UUID.randomUUID() + "." +FileFormat; |
|
|
@ -108,7 +108,7 @@ public class QRCodeUtil { |
|
|
|
public static String createCodeToFileType(String content) { |
|
|
|
public static String createCodeToFileType(String content) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
//getResource("/")等同于到resource文件夹下
|
|
|
|
//getResource("/")等同于到resource文件夹下
|
|
|
|
String imgPath = CommonConstant.SYSTEMFILEPATH; |
|
|
|
String imgPath = CommonConstant.SYSTEMFILEPATH+"qrCodeImg/"; |
|
|
|
File codeImgFileSaveDir = new File(imgPath); |
|
|
|
File codeImgFileSaveDir = new File(imgPath); |
|
|
|
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
|
|
|
|
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
|
|
|
|
String fileName = UUID.randomUUID() + "." +FileFormat; |
|
|
|
String fileName = UUID.randomUUID() + "." +FileFormat; |
|
|
|