소스 검색

优化最小id声部

skyblued 3 년 전
부모
커밋
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++){