From a8d9f510c364230726111f2c1292d4e36ace8689 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 19 Aug 2022 16:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=9C=B0=E5=9D=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/utils/file/FileUploadUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index e8830ba..7676b19 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -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; } }