fix:修复中文文件名找不到文件问题

This commit is contained in:
zwt13703
2026-05-14 09:07:13 +08:00
parent 6006e1d1b9
commit a62d2fd664
2 changed files with 21 additions and 1 deletions
@@ -97,7 +97,9 @@ public class OnlinePreviewController {
model.addAttribute("file", fileAttribute);
FilePreview filePreview = previewFactory.get(fileAttribute);
logger.info("预览文件url{}previewType{}", fileUrl, fileAttribute.getType());
fileUrl =WebUtils.urlEncoderencode(fileUrl);
if (!fileUrl.startsWith("file://")) {
fileUrl = WebUtils.urlEncoderencode(fileUrl);
}
if (ObjectUtils.isEmpty(fileUrl)) {
return otherFilePreview.notSupportedFile(model, "非法路径,不允许访问");
}