|
@@ -102,18 +102,48 @@ router.get("/downloadFile",function(req,res,next)
|
|
|
//遍历课件
|
|
|
for (var i = 0; i < courseListSize; i++)
|
|
|
{
|
|
|
- //资源集合
|
|
|
- var resourceList = courseList[i].list;
|
|
|
+ var lessonware = courseList[i];
|
|
|
+ if(lessonware.type == ljConst.RES_TYPE_IMAGE || lessonware.type == ljConst.RES_TYPE_VIDEO){
|
|
|
+ //资源集合
|
|
|
+ var resourceList = lessonware.list;
|
|
|
+
|
|
|
+ //资源数
|
|
|
+ var resourceSize = resourceList.length;
|
|
|
+
|
|
|
+ for (var j = 0; j < resourceSize; j++)
|
|
|
+ {
|
|
|
+ logHelper.debug(resourceList[j].url);
|
|
|
+ var url = resourceList[j].url;
|
|
|
+ fileHelper.downloadFile(url)
|
|
|
+ }
|
|
|
+ }else if(lessonware.type == ljConst.RES_TYPE_AUDIO){
|
|
|
+ //有声资源集合
|
|
|
+ var audioResourceList = lessonware.list;
|
|
|
+ //资源数
|
|
|
+ var resourceSize = audioResourceList.length;
|
|
|
+
|
|
|
+ for (var j = 0; j < resourceSize; j++)
|
|
|
+ {
|
|
|
+ var img = audioResourceList[j].img;
|
|
|
+ var audio = audioResourceList[j].audio;
|
|
|
+
|
|
|
+ logHelper.debug(img);
|
|
|
+ logHelper.debug(audio);
|
|
|
+ var imgUrl = img.url;
|
|
|
+ var audioUrl = audio.url;
|
|
|
+
|
|
|
+ if(ljStringHelper.isNonNull(imgUrl)){
|
|
|
+ fileHelper.downloadFile(imgUrl);
|
|
|
+ }
|
|
|
+ if(ljStringHelper.isNonNull(audioUrl)){
|
|
|
+ fileHelper.downloadFile(audioUrl);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //资源数
|
|
|
- var resourceSize = resourceList.length;
|
|
|
-
|
|
|
- for (var j = 0; j < resourceSize; j++)
|
|
|
- {
|
|
|
- logHelper.debug(resourceList[j].url);
|
|
|
- var url = resourceList[j].url;
|
|
|
- fileHelper.downloadFile(url)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
/*课件-End*/
|
|
|
|