From e1bf251bb9bb188a51e2cd5f70951be30eeedd38 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 6 Nov 2020 08:31:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=B9=B6]=E5=90=88=E5=B9=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-routing.module.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d1033bd..1bc35b5 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,16 +2,17 @@ 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 './home/home.component' +import { HomeComponent } from './home/home.component' //路由守卫 -import {AuthGuard} from './auth.guard' -import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥 +import { AuthGuard } from './auth.guard' +import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥 import { AddSixFamiliarComponent } from './ui/add-six-familiar/add-six-familiar.component'; + const routes: Routes = [ {path:'',redirectTo:'login',pathMatch:'full'}, { @@ -31,8 +32,11 @@ const routes: Routes = [ component:LoginComponent}, {path:'getNoMToken', - component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面 -]; + component:MTokenK1Component, canActivate: [AuthGuard],}, + //K1秘钥验证失败是跳转页面 + {path:'home', component:HomeComponent,canActivate: [AuthGuard],}//守卫验证 + ] + @NgModule({ imports: [RouterModule.forRoot(routes)],