@Effect()
authSignin = this.actions$
.pipe(
ofType(AuthActions.TRY_SIGNIN),
map((action: AuthActions.TrySignin) => {
console.log('AuthEffects -> authSignin');
return action.payload;
}),
switchMap((data: any) => {
this.router.navigate(['/student']);
const user: User = {
id: '1',
firstName: 'John',
lastName: 'Doe',
pesel: '19827364',
dateOfBirth: new Date(),
address: 'Canada, where clone syrup is made',
phoneNumber: '14 2345 345'
}
return [
{ type: AuthActions.TRY_SIGNIN },
{ type: UserActions.SET_USER, payload: user }
]
})
)
所以问题又来了:
有没有办法只获取一次用户凭据的值,并留下常规行为来检查身份验证?
任何暗示都会很有帮助。非常感谢。