ing
This commit is contained in:
parent
3cdee810bb
commit
51f9df8a99
|
@ -39,8 +39,8 @@ export class Effects {
|
|||
.ofType(ActionType.SigninSuccess)
|
||||
.map((action: SigninSuccess) => action.payload)
|
||||
.do(
|
||||
(result: Map<string, any>) => {
|
||||
const authToken = result['authToken'];
|
||||
(result) => {
|
||||
const authToken = result.authToken;
|
||||
// console.log(`authToken: ${authToken}`);
|
||||
|
||||
const expires = new Date();
|
||||
|
|
|
@ -69,6 +69,7 @@ export class RxWebsocketSubject<T> extends Subject<T> {
|
|||
}
|
||||
|
||||
public connect(): void {
|
||||
console.log('RxWebsocketSubject.connect');
|
||||
const wsSubjectConfig = Object.assign({}, this._wsSubjectConfig);
|
||||
if (undefined !== this._queryString) {
|
||||
wsSubjectConfig.url = wsSubjectConfig.url + '?' + this._queryString;
|
||||
|
@ -98,6 +99,7 @@ export class RxWebsocketSubject<T> extends Subject<T> {
|
|||
});
|
||||
this._reconnectionObservable.subscribe(
|
||||
() => {
|
||||
console.log('RxWebsocketSubject._reconnectionObservable.subscribe');
|
||||
this.connect();
|
||||
},
|
||||
null,
|
||||
|
|
|
@ -24,7 +24,7 @@ export class Signin implements Action {
|
|||
export class SigninSuccess implements Action {
|
||||
readonly type = ActionType.SigninSuccess;
|
||||
|
||||
constructor(public payload: any) {}
|
||||
constructor(public payload: {authToken: string, domainMember: DomainMember}) {}
|
||||
}
|
||||
|
||||
export class SigninFailure implements Action {
|
||||
|
|
|
@ -48,7 +48,9 @@ export class Effects {
|
|||
return this.memberService.signin(payload.email, payload.password);
|
||||
})
|
||||
.map((result: any) => {
|
||||
return new SigninSuccess(result);
|
||||
const authToken = result['authToken'];
|
||||
const domainMember = JSON.parse(result['domainMember']);
|
||||
return new SigninSuccess({authToken: authToken, domainMember: domainMember});
|
||||
})
|
||||
.catch((error: RESTError) => {
|
||||
return of(new SigninFailure(error));
|
||||
|
|
|
@ -23,7 +23,7 @@ export function reducer(state = initialState, action: Actions): State {
|
|||
}
|
||||
|
||||
case ActionType.SigninSuccess: {
|
||||
const domainMember = action.payload['domainMember'];
|
||||
const domainMember = action.payload.domainMember;
|
||||
return {
|
||||
...state,
|
||||
signined: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user