问题:
当我点击signOut
按钮登录到应用程序后,它成功signOut
并重定向到登录页面。但是当我刷新页面然后尝试退出时,它什么也不做。任何人都知道可能是什么问题?
代码:
// action
export class Logout implements Action {
readonly type = LOGOUT;
}
// effect
@Effect()
logout$ = this.actions$
.ofType(authAction.LOGOUT)
.pipe(
map( () => {
debugger;
this.authService.logoutUser();
return new fromRoot.Go({
path: ['/account/login'],
});
})
);
// calling action on signout
public signOut() {
this.store.dispatch(new fromStore.Logout());
}
Chrome Redux DevTools 的屏幕截图
刷新页面前:http: //prntscr.com/ne3pc0
刷新页面后:http: //prntscr.com/ne3qpr(Logout Action 后什么都没有)