app-routing.module.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { NgModule } from '@angular/core';
  2. import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
  3. // 引用路由守卫
  4. import { authGuard } from 'src/modules/user/auth.guard';
  5. const routes: Routes = [
  6. {
  7. path: '',
  8. loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  9. },
  10. {
  11. path: 'tab4',
  12. loadChildren: () => import('./tab4/tab4.module').then( m => m.Tab4PageModule)
  13. },
  14. {
  15. path: 'feedback',
  16. loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule)
  17. },
  18. {
  19. path: 'settings',
  20. loadChildren: () => import('./settings/settings.module').then( m => m.SettingsPageModule)
  21. },
  22. // {
  23. // path: 'login',
  24. // loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
  25. // },
  26. {
  27. path: 'edit-profile',
  28. loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule)
  29. },
  30. {
  31. path: 'notification-settings',
  32. loadChildren: () => import('./notification-settings/notification-settings.module').then( m => m.NotificationSettingsPageModule)
  33. },
  34. {
  35. path: 'privacy',
  36. loadChildren: () => import('./privacy/privacy.module').then( m => m.PrivacyPageModule)
  37. },
  38. {
  39. path: 'theme-settings',
  40. loadChildren: () => import('./theme-settings/theme-settings.module').then( m => m.ThemeSettingsPageModule)
  41. },
  42. {
  43. path: 'language-settings',
  44. loadChildren: () => import('./language-settings/language-settings.module').then( m => m.LanguageSettingsPageModule)
  45. },
  46.   // 添加:
  47.     {
  48.       path: 'user',
  49.       loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  50.     },
  51. {
  52. path: 'following',
  53. loadChildren: () => import('./following/following.module').then( m => m.FollowingPageModule)
  54. },
  55. {
  56. path: 'follower',
  57. loadChildren: () => import('./follower/follower.module').then( m => m.FollowerPageModule)
  58. }, {
  59. path: 'creator',
  60. loadChildren: () => import('./creator/creator.module').then( m => m.CreatorPageModule)
  61. }
  62. ];
  63. @NgModule({
  64. imports: [
  65. RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  66. ],
  67. exports: [RouterModule]
  68. })
  69. export class AppRoutingModule {}