기본 인증과 함께 게시물 요청이 있습니다.기본 인증이 Angular2와 작동하지 않습니다.
public login = (resrc: string, item: any): Observable<any> => {
this.headers.append('Authorization', 'Basic ' + btoa(item['userName']+':'+item['password']));
return this._http.post(this._beconfig.Server + "login/api/" + resrc, {headers: this.headers})
.timeoutWith(5000, Observable.throw(new Error('Request timed out.')))
.map((response: Response) => { return response; })
.catch(this.handleError);
}
여전히 브라우저에서 사용자 이름과 암호를 입력하라는 메시지가 표시됩니다.
잘못된 점을 도와주세요.
이 확실 사용자 이름과 암호 있습니까 맞습니까? – Henry