如何在 Angular 6 中优化注销?

问题描述

我有注销功能,对于特定用户,我们需要进行后端 API 调用,然后处理来自 API 调用的响应不需要太多时间,但注销过程最多需要 6-7 秒,我正在寻找方法优化这个,但找不到任何。以下是我的代码,

if(localStorage['currentUser']=='xyz'){
          this.http.post('url',email).subscribe(res => {
            localStorage.clear();
            this.router.navigate(['login']).then(() => {
              this.store.dispatch(new Logout());
            })
          })
}

非常感谢任何帮助。提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)