From 9bca5178b725eeb10302e850e47125c8a10919b9 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 29 Jan 2020 14:14:47 +0900 Subject: [PATCH] =?UTF-8?q?PI=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=8B=9C=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/services/pi.service.ts | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/projects/ucap-webmessenger-pi/src/lib/services/pi.service.ts b/projects/ucap-webmessenger-pi/src/lib/services/pi.service.ts index a7b1e274..34161cf5 100644 --- a/projects/ucap-webmessenger-pi/src/lib/services/pi.service.ts +++ b/projects/ucap-webmessenger-pi/src/lib/services/pi.service.ts @@ -1,8 +1,8 @@ import { Injectable, Inject } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpRequest, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, filter } from 'rxjs/operators'; import { Login2Request, @@ -45,15 +45,22 @@ export class PiService { } public login2(req: Login2Request): Observable { - return this.httpClient - .post( - this.urls.login2, - {}, - { - params: encodeLogin2(req) + const httpReq = new HttpRequest( + 'POST', + this.urls.login2, + encodeLogin2(req), + { reportProgress: true } + ); + + return this.httpClient.request(httpReq).pipe( + filter(event => { + if (event instanceof HttpResponse) { + return true; } - ) - .pipe(map(res => decodeLogin2(res))); + return false; + }), + map(res => decodeLogin2((res as HttpResponse).body)) + ); } public userTermsAction(