首页 > 解决方案 > 当我单击电子邮件中的忘记密码链接时,Angular 4 重定向到登录?

问题描述

当我收到电子邮件并单击它或将其复制粘贴到浏览器中时,我在 Angular 中忘记了密码,它会毫无理由地重定向到登录页面,无论是单例还是子例。

  // { path: 'login', component: LoginComponent },
// { path: 'reset/:token', component: ResetPasswordComponent, pathMatch: 'full' },
  {
    path: 'guest',
    component: GuestComponent,
    canActivateChild: [GuestGuardService],
    children: [
      {
        path: 'login',
        component: LoginComponent
      },
      // {
      //   path: 'forgot',
      //   component: ForgotPassComponent,
      // },
      {
        path: 'forgot/:token',
        component: ResetPasswordComponent,
      }
    ]
  },

来宾组件 HTML 具有:<router-outlet></router-outlet> 将链接放在忘记密码链接旁边时,它可以工作,但不能通过电子邮件工作。有人知道吗? GuestGuardService只看它是否正在登录并注销。

标签: angular2-routing

解决方案


推荐阅读