skyblued 2 лет назад
Родитель
Сommit
b629eb61aa
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/views/live-class/index.tsx
  2. 1 1
      src/views/video-class/index.tsx

+ 1 - 1
src/views/live-class/index.tsx

@@ -45,7 +45,7 @@ export default defineComponent({
     } catch {
       //
     }
-    const list = this.subjectList.map((n: any) => n.subjects).flat().sort((a,b) => a.id - b.id)
+    const list = this.subjectList.map((n: any) => n.subjects).flat().filter(n => typeof n === 'object').sort((a,b) => a.id - b.id)
     const userSubjectId = state.user.data?.subjectId.split(',').map(n => parseInt(n)) || [this.params.subjectId]
     let isRest = true
     for(let i = 0; i < list.length; i++){

+ 1 - 1
src/views/video-class/index.tsx

@@ -45,7 +45,7 @@ export default defineComponent({
     } catch {
       //
     }
-    const list = this.subjectList.map((n: any) => n.subjects).flat().sort((a,b) => a.id - b.id)
+    const list = this.subjectList.map((n: any) => n.subjects).flat().filter(n => typeof n === 'object').sort((a,b) => a.id - b.id)
     const userSubjectId = state.user.data?.subjectId.split(',').map(n => parseInt(n)) || [this.params.lessonSubject]
     let isRest = true
     for(let i = 0; i < list.length; i++){