0

这是功能:

onSubmit(value){
this.authService.login(value.email, value.password)
.then(
  res=> {})
.catch(error=>
          {console.log(error);}
 )
}

我认为在 res 中我必须设置超时。我有 authGuard,这就是我需要超时的原因。

4

1 回答 1

0

改成这个;

onSubmit(value){
   this.authService.login(value.email, value.password)
   .then(
      res=> {
        setTimeout(()=>{this.navigateByUrl('/home');}, 1000);
      })
   .catch(error=>
      {console.log(error);}
    )
}

希望能帮助到你;

于 2018-09-13T18:28:39.763 回答