Commit bef6f00e59099e352b7ca260b7c2ed5c3982d23e

Authored by Eric Fernandez
1 parent 195b1d0198
Exists in master

refactor

src/js/requestHeadersInterceptor.js
1 1 angular.module('focaConfiguracion')
2 2 .factory("RequestHeadersInterceptor", [
3   - '$localStorage', function($localStorage) {
  3 + '$localStorage', '$cookies', function($localStorage, $cookies) {
4 4 var request = {
5 5 request: function(config) {
  6 +
  7 + var nombreUsuario = $cookies.get('nombreUsuario');
  8 +
6 9 config.headers["X-Terminal-Key"] = $localStorage.terminalKey;
  10 + config.headers["Nombre-Usuario"] = nombreUsuario;
7 11 return config;
8 12 }
9 13 }
10   -
  14 +
11 15 return request;
12 16 }
13 17 ]);
14 18 \ No newline at end of file
1 1 angular.module('focaConfiguracion')
2 2 .factory("focaConfiguracionService", [
3   - '$http', 'ENDPOINT_BASE',
4   - function($http, ENDPOINT_BASE) {
  3 + '$http', 'API_ENDPOINT',
  4 + function($http, API_ENDPOINT) {
5 5 return {
6 6 getHashTerminal: function() {
7   - return $http.get(ENDPOINT_BASE + '/terminal/obtener');
  7 + return $http.get(API_ENDPOINT.ENDPOINT_BASE + '/terminal/obtener');
8 8 }
9 9 }
10 10 }