【问题标题】:Invalid configuration of route '': redirectTo and canActivate cannot be used together路由 \'\' 的无效配置:redirectTo 和 canActivate 不能一起使用
【发布时间】:2023-02-15 20:27:42
【问题描述】:

我想做 laravel angular jwt 身份验证,所以我想应用 guard 但它给我错误:Invalid configuration of route '': redirectTo and canActivate cannot be used together. Redirects happen before activation so canActivate will never be executed

应用程序路由.module.ts

const routes: Routes = [
  { path:"", redirectTo:"/adress", pathMatch:'full', canActivate:[AuthGuard] },
];

【问题讨论】:

    标签: angular guard canactivate


    【解决方案1】:

    这是同一问题的答案:https://stackoverflow.com/a/74052870/4983912。我希望这不仅对我有帮助。

    【讨论】:

      猜你喜欢
      • 2021-07-02
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-04
      • 1970-01-01
      • 2016-10-23
      • 2017-01-25
      相关资源
      最近更新 更多