From f1b43075351d397be8b4fb146af95acff0cdf0cb Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Thu, 8 Sep 2022 10:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ink/wgink/module/file/components/FileComponent.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module-file/src/main/java/ink/wgink/module/file/components/FileComponent.java b/module-file/src/main/java/ink/wgink/module/file/components/FileComponent.java index ec9fdb69..9a9a0905 100644 --- a/module-file/src/main/java/ink/wgink/module/file/components/FileComponent.java +++ b/module-file/src/main/java/ink/wgink/module/file/components/FileComponent.java @@ -87,6 +87,9 @@ public class FileComponent { */ public String getFileUrl(String uploadPath) { String fileUrl = uploadPath.replace(fileProperties.getUploadPath(), ""); + if ("\\".equals(File.separator)) { + fileUrl = fileUrl.replace("\\", "/"); + } if (fileUrl.startsWith("/")) { fileUrl = fileUrl.substring(1); }