Commit ea2cb8ea9538f8154f843b39851e75abc24ef539
1 parent
92c3081c2c
Exists in
master
servicio consultar login
Showing
1 changed file
with
11 additions
and
2 deletions
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 |