|
|
|
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 { HomeComponent } from './ui/home/home.component'
|
|
|
|
|
|
|
|
//路由守卫
|
|
|
|
import { AuthGuard } from './auth.guard'
|
|
|
|
import { AddSixFamiliarComponent } from './ui/add-six-familiar/add-six-familiar.component';
|
|
|
|
import { TrainingRecordinfoComponent } from './ui/training-recordinfo/training-recordinfo.component';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const routes: Routes = [
|
|
|
|
{path:'',redirectTo:'login',pathMatch:'full'},
|
|
|
|
// {
|
|
|
|
// path:'',
|
|
|
|
// component:NavigationComponent,
|
|
|
|
// canActivate: [AuthGuard],//守卫验证
|
|
|
|
// children:[
|
|
|
|
// {path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)},
|
|
|
|
// {path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)},
|
|
|
|
// ]
|
|
|
|
// },
|
|
|
|
{path:'addsixfamiliar',
|
|
|
|
component:AddSixFamiliarComponent,canActivate: [AuthGuard],},
|
|
|
|
{path:'trainingrecordinfo',
|
|
|
|
component:TrainingRecordinfoComponent,canActivate: [AuthGuard],},
|
|
|
|
{path:'login',
|
|
|
|
component:LoginComponent},
|
|
|
|
|
|
|
|
{path:'home', component:HomeComponent,canActivate: [AuthGuard],}//守卫验证
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [RouterModule.forRoot(routes)],
|
|
|
|
exports: [RouterModule]
|
|
|
|
})
|
|
|
|
export class AppRoutingModule { }
|