fuliqi
2024-06-06 0af507deb2a8b08a606b795d73c660d02ecb7f49
src/router.js
@@ -88,7 +88,8 @@
      {
        path: 'teacher-manage',
        name: 'teacherManage',
        component: () => import('@/views/Manage/Education/TeacherManage.vue')
        component: () => import('@/views/Manage/Education/TeacherManage.vue'),
        meta: { title: '教师管理' }
      },
      // 教师介绍
      {
@@ -119,18 +120,33 @@
        path: 'test-paper',
        name: 'TestPaper',
        component: () => import('@/views/Manage/TestPaper/index.vue'),
        meta: { title: '试卷管理' }
      },
      // 题库管理
      {
        path: 'question-bank',
        name: 'QuestionBank',
        component: () => import('@/views/Manage/TestPaper/QuestionBank.vue'),
        meta: { title: '题库管理' }
      },
      // 科目管理
      {
        path: 'subject',
        name: 'subject',
        component: () => import('@/views/Manage/TestPaper/subject.vue'),
        meta: { title: '科目管理' }
      },
      // 试卷生成
      {
        path: 'test-paper-generation',
        name: 'TestPaperGeneration',
        component: () => import('@/views/Manage/TestPaper/TestPaperGeneration.vue')
      },
      //随机试卷模板管理
      {
        path: 'paper-template',
        name: 'PaperTemplate',
        component: () => import('@/views/Manage/TestPaper/PaperTemplate.vue')
      },
      // 班级管理
      {
@@ -141,11 +157,13 @@
          {
            path: '/',
            name: 'ClassManagementIndex',
            component: () => import('@/views/Manage/ClassManagement/Class.vue')
            component: () => import('@/views/Manage/ClassManagement/Class.vue'),
            meta: { title: '班级管理' }
          }, {
            path: 'Class-staff',
            name: 'ClassStaff',
            component: () => import('@/views/Manage/ClassManagement/ClassStaff.vue')
            component: () => import('@/views/Manage/ClassManagement/ClassStaff.vue'),
            meta: { title: '班级成员管理' }
          }
        ]
      },
@@ -208,6 +226,14 @@
  routes: constantRoutes
})
router.beforeEach((to,from,next)=>{
  if(to.meta.title){//判断是否有标题
    document.title = to.meta.title
  }
  next()  //执行进入路由,如果不写就不会进入目标页
})
export {
  constantRoutes,
  router