Commit 466891df authored by prumde's avatar prumde

Updated ecm-signin.service.ts


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174516 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ce22a085
......@@ -4,22 +4,25 @@ import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import {Store} from '@ngrx/store';
import { HostUrlService } from '../host-url.service';
@Injectable()
export class ECMSigninService {
constructor (private http: Http,) {}
constructor (public hostUrlService : HostUrlService,private http: Http,) {
}
sendLogin(_username: string, _password: string): Observable<any> {
let authUrl = '/ecm/service/sys/auth/login'; // URL to web service
console.log( "sendLogin 1...." + this.hostUrlService.hostUrl);
let _urlParams = new URLSearchParams();
_urlParams.append('username', _username);
_urlParams.append('password', _password);
console.log( "sendLogin 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "sendLogin 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......@@ -35,7 +38,7 @@ export class ECMSigninService {
console.log( "sendLogin 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "sendLogin 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......@@ -47,8 +50,8 @@ export class ECMSigninService {
let userdataUrl = '/ecm/service/feeds/userdata'; // URL to Web Service
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
console.log( "Fetch user data...." + userdataUrl);
return this.http.post( userdataUrl, {}, options )
console.log( "Fetch user data...." + this.hostUrlService.hostUrl+userdataUrl);
return this.http.post( this.hostUrlService.hostUrl+userdataUrl, {}, options )
.map(this.extractData)
.catch(this.handleError);
}
......@@ -61,7 +64,7 @@ export class ECMSigninService {
console.log( "forgot 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "forgot 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......@@ -77,7 +80,7 @@ export class ECMSigninService {
console.log( "verify 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "verify 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......@@ -94,7 +97,7 @@ export class ECMSigninService {
console.log( "changePassword 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "changePassword 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......@@ -113,7 +116,7 @@ export class ECMSigninService {
console.log( "changePassword 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl+authUrl + '?' + _urlParams.toString();
console.log( "changePassword 2...." + authUrl);
return this.http.get( authUrl, options )
.map(this.extractData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment