这是我的主要路线文件
let baseRoute= Config.loginFirstName==null ? 'abcd':Config.loginFirstName;
const routes: Routes = [
{path: '', redirectTo: '/'+baseRoute+'/'+Config.role+'/dashboard/home', pathMatch: 'full' },
{path:'help', component:HelpComponent},
{path:'register', component:RegisterComponent},
{path:'forget-password',component:ForgetPasswordComponent},
{ path: baseRoute, loadChildren: () => import('./pages/pages.module').then(m => m.PagesModule) },
{path:'**', component:NotfoundComponent}
];
这是 page.module 路由
const routes: Routes = [{ path: '', component: PagesComponent },
{
path: 'customer',
loadChildren: () => import('./customer/customer.module').then(m => m.CustomerModule)
},
{
path: 'organizer',
loadChildren: () => import('./organizer/organizer.module').then(m => m.OrganizerModule),
canActivate: [AuthGuardOrganizer]
},
当有人以名称“xyz”以供应商身份登录时出现问题,因此它重定向到“xyz/vendor”路由并且它第一次工作,但是当以客户身份以名称“abc”登录时,它的路由将是 abc/customer它的重定向不起作用。
谢谢