From 8dffbfda042d6f93927b332d6c0225abe3c0a247 Mon Sep 17 00:00:00 2001 From: lu Date: Thu, 25 Jul 2024 15:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=AF=BC=E5=87=BA=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xboe/module/course/api/CoursePortalApi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java index 743e91cb..16331c8e 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CoursePortalApi.java @@ -369,7 +369,7 @@ public class CoursePortalApi extends ApiBaseController{ } //作业导出 @GetMapping("/export") - public void export(String contentId,HttpServletResponse response) throws IOException { + public void export(String contentId, String courseName,HttpServletResponse response) throws IOException { //将courseId以逗号分割转换为list List contentIds = Arrays.asList(contentId.split(",")); Mapmap=new HashMap<>(); @@ -393,13 +393,13 @@ public class CoursePortalApi extends ApiBaseController{ if(course==null || course.getDeleted()){ throw new RuntimeException("课程不存在或已被删除"); } - map.put(course.getName()+"--"+courseContent.getContentName()+extension, e.getFile()); + map.put(course.getName()+"--"+courseContent.getContentName()+extension, "/home/www/elearning/upload"+e.getFile()); } }); } catch (Exception e) { throw new RuntimeException("导出异常"); } - String encodedFilename = URLEncoder.encode("作业.zip") + String encodedFilename = URLEncoder.encode(courseName+"【作业】.zip") .replace("+", "%20") // 空格替换为"%20" .replace("%2F", "/"); // 解决斜杠问题 StringBuilder contentDispositionValue = new StringBuilder();