生成二维码时验证路径是否存在

master
gongzhenkun 2 years ago
parent f40e99611e
commit d09f4043a2

@ -283,6 +283,8 @@ public class FileUploadUtils
String codeName = UUID.randomUUID().toString();// 二维码的图片名
String imageType = "jpg";// 图片类型
picPath = DateUtils.datePath() + "/" + codeName + "." + imageType;
// 判断文件夹是否存在,不存在时新建文件夹
getAbsoluteFile(path, picPath).getAbsolutePath();
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map<EncodeHintType, String> hints = new HashMap<EncodeHintType, String>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");

Loading…
Cancel
Save