更新时间:2023-12-02 15:18:46
在这种情况下,我可能会将所有内容重定向到 DashboardComponent
使用
In this case I would probably redirect everything to DashboardComponent
using
{path:``,redirectTo:'dashboard',pathMatch:'full'}
,然后仪表板组件可以确定用户是否登录(由于AuthGuard处于活动状态),如果用户未登录,它将重定向他以登录
and than the dashboard component can determinate if the user is logged in or not (as it has AuthGuard active), and if the user is not logged in it would redirect him to login.