diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 08329508..a11f59f3 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -1395,8 +1395,13 @@ export default { } }, // ai播放器相关 - 视频处理 - handleAIVideo(list = [], r) { - console.log('触发了-----------list', list); + handleAIVideo(listParam, r) { + // 先打印原始值,便于排查后端返回 + console.log('触发了-----------原始 listParam', listParam); + // 防御性处理:后端可能返回 null 或其他非数组,这里统一转为数组,避免后续 forEach 报错 + const list = Array.isArray(listParam) ? listParam : []; + // 再打印一次最终用于处理的 list + console.log('触发了-----------规范后 list', list); this.SET_selectableLang(list); this.SET_courseInfo(this.courseInfo); if (this.courseInfo.aiSet && this.courseInfo.aiAbstract == 1 && this.courseInfo.summaryContent) {