You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
969 B
33 lines
969 B
4 years ago
|
import { NgModule } from '@angular/core';
|
||
|
import { Routes, RouterModule } from '@angular/router';
|
||
|
import { LoginComponent } from './pages/login/login.component';
|
||
|
import { RegisterComponent } from './pages/register/register.component';
|
||
|
import { NavigationComponent } from './navigation/navigation.component';
|
||
|
|
||
|
//路由守卫
|
||
|
import {AuthGuard} from './auth.guard'
|
||
|
import { MTokenK1Component } from './m-token-k1/m-token-k1.component';
|
||
|
|
||
|
|
||
|
|
||
|
const routes: Routes = [
|
||
|
{path:'',redirectTo:'login',pathMatch:'full'},
|
||
|
{
|
||
|
path:'',
|
||
|
component:NavigationComponent,
|
||
|
canActivate: [AuthGuard],//守卫验证
|
||
|
children:[
|
||
|
{path:'datacollection',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}
|
||
|
]},
|
||
|
|
||
|
{path:'login', component:LoginComponent}, //登录页
|
||
|
{path:'register', component:RegisterComponent,}, //注册页
|
||
|
|
||
|
];
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [RouterModule.forRoot(routes)],
|
||
|
exports: [RouterModule]
|
||
|
})
|
||
|
export class AppRoutingModule { }
|