app.routes.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { Routes,mapToCanActivate } from '@angular/router';
  2. import { AuthGuard } from '../services/auth.guard';
  3. import { CompUserComponent } from './comp-user/comp-user.component';
  4. import { ProfileComponent } from '../modules/user/profile/profile.component'
  5. import { CompManageComponent } from './comp-manage/comp-manage.component'
  6. import {PageHomeComponent} from '../modules/textbook/page-home/page-home.component'
  7. export const routes: Routes = [
  8. { path: '', redirectTo:'user/login', pathMatch: "full",}, // 默认跳转到 ''
  9. // { path: '',loadComponent:()=>import('../modules/textbook/page-home/page-home.component').then(m=>m.PageHomeComponent) }, // 默认跳转到 ''
  10. {
  11. path: 'home', // 首页
  12. canActivate: mapToCanActivate([AuthGuard]),
  13. component: PageHomeComponent,
  14. },
  15. {
  16. path: 'user', // 用户登录/注册
  17. component: CompUserComponent,
  18. loadChildren:()=> import('../modules/login/modules.routes').then((mod) => mod.LoginRoutingModule),
  19. },
  20. {
  21. path: 'profile', // 用户登录/注册
  22. component: ProfileComponent,
  23. },
  24. {
  25. path: 'common', //教材详情
  26. component: CompManageComponent,
  27. canActivate: mapToCanActivate([AuthGuard]),
  28. loadChildren: () =>import('../modules/common/modules.routes').then((mod) => mod.CommonRoutingModule),
  29. },
  30. {
  31. path: 'nav-admin', //国家级管理员管理平台
  32. component: CompManageComponent,
  33. canActivate: mapToCanActivate([AuthGuard]),
  34. loadChildren: () =>import('../modules/nav-admin/modules.routes').then((mod) => mod.NavAdminRoutingModule),
  35. },
  36. {
  37. path: 'nav-province-contact',//工作联系人:中央部门所属高校联系人、部省合建高校联系人、出版单位联系人、省属高校流程管理员
  38. component: CompManageComponent,
  39. canActivate: mapToCanActivate([AuthGuard]),
  40. loadChildren: () =>import('../modules/nav-province-contact/modules.routes').then((mod) => mod.NavProContactRoutingModule),
  41. },
  42. // {
  43. // path: 'nav-province-submit',//省级教育行政部门
  44. // component: CompManageComponent,
  45. // canActivate: mapToCanActivate([AuthGuard]),
  46. // loadChildren: () =>import('../modules/nav-province-submit/modules.routes').then((mod) => mod.NavProRoutingModule),
  47. // },
  48. {
  49. path: 'nav-province-school-contact', //高校联系人
  50. component: CompManageComponent,
  51. canActivate: mapToCanActivate([AuthGuard]),
  52. loadChildren: () =>import('../modules/nav-province-school-contact/modules.routes').then((mod) => mod.NavProSchoolRoutingModule),
  53. },
  54. {
  55. path: 'nav-review', //教材评审组成员
  56. component: CompManageComponent,
  57. canActivate: mapToCanActivate([AuthGuard]),
  58. loadChildren: () =>import('../modules/nav-review/modules.routes').then((mod) => mod.NavReviewRoutingModule),
  59. },
  60. {
  61. path: 'nav-author', //作者 / 教师 / 主编
  62. component: CompManageComponent,
  63. canActivate: mapToCanActivate([AuthGuard]),
  64. loadChildren: () =>import('../modules/nav-author/modules.routes').then((mod) => mod.NavAuthorRoutingModule),
  65. },
  66. {
  67. path: 'test/upload', // 用户登录/注册
  68. loadComponent:()=> import('../app/comp-upload/example-upload/example-upload.component').then((mod) => mod.ExampleUploadComponent),
  69. }
  70. ];