我正在使用Angular 6并将我的路由配置为
export const AuthLayoutRoutes: Routes = [
{ path: 'reset-password/:password_hash/:user_id_hash', component: ResetPasswordComponent},
];但是当我访问网址的时候
https://example.com/reset-password/8d042fcb-8892/c81e728d9d4c2f它给出404错误。
只访问https://example.com/reset-password正在加载组件。
发布于 2019-12-16 19:16:12
您应该使用相同的组件定义多个路由,使用和不使用最后一个参数,如下所示:
export const AuthLayoutRoutes: Routes = [
{ path: 'reset-password/:password_hash/:user_id_hash', component: ResetPasswordComponent},
{ path: 'reset-password/:password_hash', component: ResetPasswordComponent},
];我希望它有帮助;)
发布于 2018-09-12 06:58:10
https://stackoverflow.com/questions/52288850
复制相似问题