Kaynağa Gözat

获取当前登录学生的学科列表

CzRger 3 hafta önce
ebeveyn
işleme
c74bea26e9
2 değiştirilmiş dosya ile 4 ekleme ve 8 silme
  1. 2 2
      src/api/modules/study/index.ts
  2. 2 6
      src/stores/modules/app.ts

+ 2 - 2
src/api/modules/study/index.ts

@@ -1,7 +1,7 @@
 import { get, post } from '@/api/request'
 // 获取学科
-export const systemSubjectList = (params) =>
-  get(`/system/subject/list`, params, {})
+export const systemSubjectStudentList = () =>
+  get(`/system/subject/student/list`, {}, {})
 // 学习计划
 export const trainingCampLearningPlanList = (params) =>
   get(`/trainingCamp/learningPlan/list`, params, {})

+ 2 - 6
src/stores/modules/app.ts

@@ -1,6 +1,6 @@
 import { defineStore } from 'pinia'
 import { systemStudent, systemUserGetInfo } from '@/api/modules/global'
-import { systemSubjectList } from '@/api/modules/study'
+import { systemSubjectStudentList } from '@/api/modules/study'
 import router from '@/router'
 import { ElMessage } from 'element-plus'
 
@@ -41,11 +41,7 @@ export const useAppStore = defineStore('app', {
                   reject('')
                   return
                 }
-                systemSubjectList({
-                  pageNum: 1,
-                  pageSize: 10,
-                  category: this.studentInfo?.grade,
-                }).then(({ rows }: any) => {
+                systemSubjectStudentList().then(({ rows }: any) => {
                   const categoryMenus: any = []
                   const map = new Map()
                   rows.forEach((su) => {