我有ngrx效果,它处理登录操作 . 最后一个 switchMap 返回一个令牌字符串,该字符串应该传递给下一个observable . 当我启动应用程序时,最后一个 switchMap 确实返回一个令牌字符串,但下一个 mergeMap 运算符只接收了令牌字符串的第一个字符 .

如何将完整的字符串传递给mergeMap运算符?也许我应该使用其他一些运算符来实现这一点,但是哪一个呢?

@Effect()
  authLogin = this.actions$.ofType(AuthActions.TRY_LOGIN)
    .map((action: AuthActions.TryLogin) => {
      return action.payload;
    })
    .switchMap((authData: { username: string, password: string }) => {
      return this.http.post(this.apiName + 'auth/login', authData);
    })
    .switchMap((respons: any) => {
      return respons;
    })
    .mergeMap((token: string) => {    
      return [
        {
          type: AuthActions.LOGIN
        },
        {
          type: AuthActions.SET_TOKEN,
          payload: token
        }
      ];
    })
    .take(1)
    .do(() => {
      this.router.navigate(['profile']).catch(err => console.warn(err));
    })
    .catch(err => {
      throw 'ERROR IN TRY SIGN IN EFFECT. DETAILS: ' + err;
    });