Commit 5d9ded8902846eeacf6063a6b6ebc366ac982096
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request !4
Showing
1 changed file
 
Show diff stats
src/js/service.js
| 1 | angular.module('focaLogin') | 1 | angular.module('focaLogin') | 
| 2 | .service('focaLoginService', [ | 2 | .service('focaLoginService', [ | 
| 3 | '$http', 'API_ENDPOINT', 'APP', | 3 | '$http', 'API_ENDPOINT', 'APP', '$cookies', | 
| 4 | function($http, API_ENDPOINT, APP) { | 4 | function($http, API_ENDPOINT, APP, $cookies) { | 
| 5 | return { | 5 | return { | 
| 6 | login: function(usuario) { | 6 | login: function(usuario) { | 
| 7 | if (APP) { | 7 | if (APP) { | 
| 8 | APP = '/' + APP; | 8 | APP = '/' + APP; | 
| 9 | } | 9 | } | 
| 10 | 10 | ||
| 11 | return $http.post(API_ENDPOINT.URL + '/usuario/login' + APP , usuario); | 11 | return $http.post(API_ENDPOINT.URL + '/usuario/login' + APP , usuario); | 
| 12 | }, | ||
| 13 | getLoginData: function() { | ||
| 14 | if ($cookies.get('chofer')) { | ||
| 15 | return {chofer: $cookies.get('chofer')}; | ||
| 16 | } | ||
| 17 | |||
| 18 | if ($cookies.get('vendedorCobrador')) { | ||
| 19 | return {vendedorCobrador: $cookies.get('vendedorCobrador')}; | ||
| 20 | } | ||
| 12 | } | 21 | } | 
| 13 | }; | 22 | }; | 
| 14 | } | 23 | } | 
| 15 | ]); | 24 | ]); | 
| 16 | 25 |