Generation

generate functionMon, 20 Mar 2023

mejorar ese código getToken(valor: number): Observable<any> { let token = ''; let tokenUrl = ''; if (valor == 1) { token = 'Basic ' + btoa(this.user_api + ':' + this.pass_api); tokenUrl = this.tokenUrl_api; } if (valor == 2) { token = 'Basic ' + btoa(this.user_trilceapi + ':' + this.pass_trilceapi); tokenUrl = this.tokenUrl_trilceapi; } let ling = tokenUrl; const header = new HttpHeaders({ Authorization: token, }); return this._http.post(ling, null, {headers: header}); }

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant