Merge pull request #2198 from wknet123/release-1.1.0-fix

Encode sign-in params.
This commit is contained in:
kun wang 2017-05-03 19:05:30 +08:00 committed by GitHub
commit 11beddaaf9

View File

@ -68,12 +68,11 @@ export class SessionService {
//Submit signin form to backend (NOT restful service) //Submit signin form to backend (NOT restful service)
signIn(signInCredential: SignInCredential): Promise<any> { signIn(signInCredential: SignInCredential): Promise<any> {
//Build the form package //Build the form package
const body = new URLSearchParams(); let queryParam:string = 'principal=' + encodeURIComponent(signInCredential.principal) +
body.set('principal', signInCredential.principal); '&password=' + encodeURIComponent(signInCredential.password);
body.set('password', signInCredential.password);
//Trigger Http //Trigger Http
return this.http.post(signInUrl, body.toString(), { headers: this.formHeaders }) return this.http.post(signInUrl, queryParam, { headers: this.formHeaders })
.toPromise() .toPromise()
.then(() => null) .then(() => null)
.catch(error => this.handleError(error)); .catch(error => this.handleError(error));