From 6c2e378717708d4b7b2e7625c38baba4527466a0 Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Thu, 18 Aug 2022 19:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3?= 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, 5 insertions(+) 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 dba7c37..07938a5 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 @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.UUID; import org.apache.commons.io.FilenameUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; @@ -30,6 +32,7 @@ import javax.servlet.http.HttpServletRequest; */ public class FileUploadUtils { + private static final Logger logger = LoggerFactory.getLogger(FileUploadUtils.class); /** * 默认大小 50M */ @@ -256,6 +259,7 @@ public class FileUploadUtils b[i] += 256; } } + logger.info("file path :{}{}", uploadFilePath, imgClassPath); // 保存图片 OutputStream out = new FileOutputStream(uploadFilePath.concat(imgClassPath)); out.write(b); @@ -264,6 +268,7 @@ public class FileUploadUtils // 返回图片的相对路径 = 图片分类路径+图片名+图片后缀 return imgClassPath; } catch (IOException e) { + logger.error("generateImage error", e); return null; } }