在某些情况下,我尝试通过执行以下操作重定向到解析为当前视图/视图模型的同一路由器上的另一个路由:
return new RedirectToRoute('participant-project-dashboard', {
projectId: this.projects[0].id,
projectUserId: this.projects[0].projectUserId,
});
路由配置如下:
config.map([
// ...
{
route: ['projects/:projectId/users/:projectUserId/dashboard'],
name: 'participant-project-dashboard',
moduleId: './project/dashboard/participant-project-dashboard',
nav: false,
title: 'AppName',
},
// ...
]);
正在解决的问题是:在我的浏览器的地址栏中,我看到:
localhost:3001/#/projects/dd08adad-e67b-44cd-9f12-534f1b48b5b6/users/c6667081-5757-4cdc-8637-8935fa2fdb66/dashboard
但在控制台中我收到以下错误:
aurelia-logging-console.js:54 ERROR [app-router] Error: Route not found: /projects/dd08adad-e67b-44cd-9f12-534f1b48b5b6/users/c6667081-5757-4cdc-8637-8935fa2fdb66/dashboard(…)
显然找到了我的路线,为什么我会找到“未找到路线”?