json.js 609 B

12345678910111213141516171819202122232425
  1. var fs = require('fs');
  2. var logHelper = require("../helper/LjLogHelper.js");
  3. var lessonJsonObj = JSON.parse(fs.readFileSync("../audio.json"));
  4. /*课件-Begin*/
  5. //课程集合
  6. var courseList = lessonJsonObj.data.list;
  7. //课程数
  8. var courseListSize = courseList.length;
  9. //遍历课件
  10. for (var i = 0; i < courseListSize; i++)
  11. {
  12. logHelper.info(courseList[i].title);
  13. //资源集合
  14. var resourceList = courseList[i].list;
  15. //资源数
  16. var resourceSize = resourceList.length;
  17. for (var j = 0; j < resourceSize; j++)
  18. {
  19. logHelper.info(resourceList[j].url);
  20. }
  21. }
  22. /*课件-End*/