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
1001 B
33 lines
1001 B
5 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 { LockscreenComponent } from './pages/lockscreen/lockscreen.component';
|
||
|
|
||
|
//路由守卫
|
||
|
import {AuthGuard} from './auth.guard'
|
||
|
|
||
|
|
||
|
|
||
|
const routes: Routes = [
|
||
|
{path:'',redirectTo:'login',pathMatch:'full'},
|
||
|
{
|
||
|
path:'home',
|
||
|
component:NavigationComponent,
|
||
|
canActivate: [AuthGuard],//守卫验证
|
||
|
children:[
|
||
|
{path:'',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}
|
||
|
]
|
||
|
},
|
||
|
{ path:'adminLogin', component:LoginComponent}, //管理员登录路由
|
||
|
{ path:'login', component:LockscreenComponent}, //教员学员登录路由
|
||
|
|
||
|
];
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [RouterModule.forRoot(routes)],
|
||
|
exports: [RouterModule]
|
||
|
})
|
||
|
export class AppRoutingModule { }
|