这是功能:
onSubmit(value){
this.authService.login(value.email, value.password)
.then(
res=> {})
.catch(error=>
{console.log(error);}
)
}
我认为在res中我必须设置超时。我有authGuard,这就是我需要超时的原因。
改变它;
onSubmit(value){
this.authService.login(value.email, value.password)
.then(
res=> {
setTimeout(()=>{this.navigateByUrl('/home');}, 1000);
})
.catch(error=>
{console.log(error);}
)
}
希望能帮助到你;