mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 09:26:48 +08:00
作业导出路径
This commit is contained in:
@@ -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<String> contentIds = Arrays.asList(contentId.split(","));
|
||||
Map<String, String>map=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();
|
||||
|
||||
Reference in New Issue
Block a user