这是我在app.module.ts中的代码。 AuthGuard似乎只能在“家庭”路径和“ office-info”路径上工作。我在做什么错了?
RouterModule.forRoot([
{ path: 'login', component: LoginComponent},
{ path: 'home', component: HomeComponent, canActivate: [AuthGuard]},
{ path: 'office-info', component: OfficeInfoComponent, canActivate: [AuthGuard]},
{ path: 'prs', component: PrsComponent, canActivate: [AuthGuard]},
{ path: 'crs', component: CrsComponent, canActivate: [AuthGuard]},
{ path: 'conf', component: ConfBookingListComponent, canActivate: [AuthGuard]},
{ path: 'afe', component: AfeListComponent, canActivate: [AuthGuard]},
{ path: 'gfocert', component: GfoCertifyListComponent, canActivate: [AuthGuard]},
{ path: 'gfointk', component: GfoIntakeListComponent, canActivate: [AuthGuard]},
{ path: 'wte', component: WteComponent, canActivate: [AuthGuard]},
{ path: 'gysearch', component: GYSearchComponent, canActivate: [AuthGuard]},
{ path: '', redirectTo: 'home', pathMatch: 'full', canActivate: [AuthGuard]},
{ path: '**', redirectTo: 'home', pathMatch: 'full', canActivate: [AuthGuard]}
])