/* * @Descripttion: * @version: * @Author: sueRimn * @Date: 2020-12-20 10:30:23 * @LastEditors: sueRimn * @LastEditTime: 2020-12-20 15:36:30 */ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { LoginComponent } from './pages/login/login.component'; import { NavigationComponent } from './navigation/navigation.component'; import { LockscreenComponent } from './pages/lockscreen/lockscreen.component'; //路由守卫 import {AuthGuard} from './auth.guard' import { CreateTestScoreComponent } from './examiner/create-test-score/create-test-score.component'; import { CollectionToolsComponent } from './ui/collection-tools/collection-tools.component'; import { ExaminationDetailsComponent } from './student/examination-details/examination-details.component'; const routes: Routes = [ {path:'',redirectTo:'login',pathMatch:'full'}, { path:'home',component:NavigationComponent,canActivate: [AuthGuard],//守卫验证 children:[ {path:'',loadChildren:() => import('./examiner/examiner.module').then(m => m.ExaminerModule)}, {path:'',loadChildren:() => import('./student/student.module').then(m => m.StudentModule)}, {path:'',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)} ] }, { path:'examiner/create-test-score', component:CreateTestScoreComponent,canActivate: [AuthGuard],}, //创建试卷具体分数页面 { path:'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //考官编制工具 { path:'examinationDetails', component:ExaminationDetailsComponent,canActivate: [AuthGuard], }, //考生试卷 考试基本信息/作战部署 { path:'adminLogin', component:LoginComponent}, //管理员登录路由 { path:'login', component:LockscreenComponent}, //教员学员登录路由 ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }