import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { AuthGuard } from './auth.guard'; import { LoginComponent } from './pages/login/login.component'; import { NavigationComponent } from './system-management/navigation/navigation.component'; const routes: Routes = [ { path: '', redirectTo: '/login', pathMatch: 'full' }, { path: 'login', component: LoginComponent, }, { path: '', component: NavigationComponent, canActivate: [AuthGuard], children: [ { path: 'system', loadChildren: () => import('./system-management/system-management.module').then(m => m.SystemManagementModule) } ] }//系统管理 ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }