【发布时间】:2021-04-17 00:20:42
【问题描述】:
我有注销功能,对于特定用户,我们需要进行后端 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());
})
})
}
非常感谢任何帮助。提前致谢。
【问题讨论】:
标签: javascript angular typescript angular6 logout