Ionic - 会话到期记住最后一页几秒钟?

Ionic - Session Expiry remembering last page for a few seconds?

我的应用程序的令牌设置为 30 分钟后过期,我的 401/403 错误设置如下:

// 401 or 403 error
async unauthorisedError() {
const alert = await this.alertController.create({
  header: 'Session has expired',
  message: 'Click OK to login again',
  buttons: [
    {
    text: 'OK',
    role: 'cancel',
    cssClass: 'secondary',
    handler: close => {
      console.log('close unauthorized');
      this.storage.clear();
      this.authenticationService.login();
      this.open = false;
       // do nothing else
    }
  }
]
 });

alert.present();
}

所以我的应用程序被重定向回登录页面,以便他们再次登录,一旦他们登录,他们就会直接重定向到主页(应该是)。

出于某种原因,当用户再次登录时,它将恢复到超时 1/2/3 秒之前的屏幕,然后重定向到主页。

有谁知道我如何才能阻止它返回到过期几秒钟的页面,或者这只是代码 运行 并试图赶上自己?

谢谢

我在应用程序中做的几乎相同,我们有一个拦截器,如果代码是 401403,我们会将用户重定向回登录页面。你可以在那里显示你的消息,你不应该再有这个"memory"问题