canActivate在默认路径路由中不起作用,有任何建议吗?
澄清-canActive在其他所有路由路径(例如,用户)中都能正常工作
const routes: Routes = [
{
path: '',
canActivate: [AlwaysAuthGuard],
redirectTo: '/hotelProducts',
pathMatch: 'full'
},
{
path: 'user',
canActivate: [AlwaysAuthGuard],
data: {
title: 'User',
restrictions: {
showHotelChannelDetails: false,
enableSave: false,
enableUndo: false
}
},
component: UserView
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true })],
exports: [RouterModule],
providers: [AlwaysAuthGuard]
})
谢谢。