下载课件时将所有课件打包成一个压缩包,名称为 课件名称-时间

master
xiaochanghai 12 months ago
parent bd9677f023
commit adceccac1f
  1. 6
      Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs

@ -154,9 +154,11 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course
var files = attachments.Select(x => $"{webRootPath}{"\\" + x.RelativePath}").ToArray(); var files = attachments.Select(x => $"{webRootPath}{"\\" + x.RelativePath}").ToArray();
if (files.Length > 0) if (files.Length > 0)
{ {
CreateZip($"{webRootPath}{outPath}", files); if (files.Length > 1)
CreateZip($"{webRootPath}{outPath}", files);
else
outPath = files[0];
return ServiceResult<string>.OprateSuccess(null, outPath); return ServiceResult<string>.OprateSuccess(null, outPath);
} }
else else
return ServiceResult<string>.OprateFailed("该课件无附件!"); return ServiceResult<string>.OprateFailed("该课件无附件!");

Loading…
Cancel
Save