我在 Angular 项目中使用 oidcSecurityService 进行身份验证。我的应用程序工作流程是登录 -> 主页 如果用户在主页上并从浏览器单击后退箭头,那么我不希望显示登录页面。相反,用户应该在主页上。 我曾尝试使用以下选项,但对我不起作用。
"historyCleanupOff": false,
@HostListener('window:popstate', ['$event'])
onPopState(event) {
debugger;
this.router.navigate(['/account']); //account = home
}
我想知道是否有其他/更好的方法来实现这一目标? 我不想让用户再次进入登录页面。