From 79ab2cbd31c022916a8e696903d5eb34b70aa403 Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期六, 25 十一月 2023 15:57:07 +0800 Subject: [PATCH] 讨论区关键字过滤、首页班级显示班级信息 --- src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java b/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java index e67a090..6f983cd 100644 --- a/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java +++ b/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java @@ -75,13 +75,17 @@ String destPath = getDestPath(name); String fullPath = config.getResRootPath() + "/" + destPath; + //鎴彇涓婁紶鍗庝负浜戠殑缂栫爜 File fileRoot = new File(fullPath.substring(0, fullPath.lastIndexOf("/"))); if (!fileRoot.exists()) { fileRoot.mkdirs(); } + + //鍘嬬缉 FileUtils.copyInputStreamToFile(in, new File(fullPath)); + //鍗庝负浜戠紪鐮佸瓨鍏ユ暟鎹簱 ResFile file = insertFileToDB(name, fullPath, destPath, getFileType(name)); return new Result(true, "success", -- Gitblit v1.8.0