passport-routing.module.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import { NgModule } from '@angular/core';
  17. import { RouterModule, Routes } from '@angular/router';
  18. import { LayoutPassportComponent } from '../../layout/passport/passport.component';
  19. import { CallbackComponent } from './callback.component';
  20. import { ForgotComponent } from './forgot/forgot.component';
  21. import { JwtAuthComponent } from './jwt-auth.component';
  22. import { UserLockComponent } from './lock/lock.component';
  23. import { UserLoginComponent } from './login/login.component';
  24. import { LogoutComponent } from './logout.component';
  25. import { UserRegisterResultComponent } from './register-result/register-result.component';
  26. import { UserRegisterComponent } from './register/register.component';
  27. const routes: Routes = [
  28. // passport
  29. {
  30. path: 'passport',
  31. component: LayoutPassportComponent,
  32. children: [
  33. {
  34. path: 'login',
  35. component: UserLoginComponent,
  36. data: { title: '登录', titleI18n: 'app.login.login' }
  37. },
  38. {
  39. path: 'register',
  40. component: UserRegisterComponent,
  41. data: { title: '注册', titleI18n: 'app.register.register' }
  42. },
  43. {
  44. path: 'register-result',
  45. component: UserRegisterResultComponent,
  46. data: { title: '注册结果', titleI18n: 'app.register.register' }
  47. },
  48. {
  49. path: 'forgot',
  50. component: ForgotComponent,
  51. data: { title: '忘记密码', titleI18n: 'app.forgot.forgot' }
  52. },
  53. {
  54. path: 'lock',
  55. component: UserLockComponent,
  56. data: { title: '锁屏', titleI18n: 'app.lock' }
  57. }
  58. ]
  59. },
  60. // 单页不包裹Layout
  61. { path: 'passport/callback/:provider', component: CallbackComponent },
  62. { path: 'passport/jwt/auth', component: JwtAuthComponent },
  63. { path: 'passport/logout', component: LogoutComponent }
  64. ];
  65. @NgModule({
  66. imports: [RouterModule.forChild(routes)],
  67. exports: [RouterModule]
  68. })
  69. export class PassportRoutingModule {}