我想使用相同的路径ticket
,因为我想在保存某些东西时重定向(使用相同的组件来更新票证)。但是有一个问题canActivate
。修复它的最佳方法是什么?
const router: Routes = [
{
path: '',
component: HomeLayoutComponent,
canActivate: [AuthGuard],
children: [
{
path: '',
component: HomeComponent
},
{
path: 'ticket',
canActivate: [SupportGuard],
component: TicketComponent
},
{
path: 'ticket',
canActivate: [CustomerGuard],
component: SiteTicketComponent
},
....
]
},
{
path: '',
component: LoginLayoutComponent,
children: [
{
path: 'login',
component: LoginComponent
},
{
path: 'signup',
component: SignupComponent
},
]
},
{
path: '**',
component: Error404Component
}
]
提前致谢。