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 | 1 | angular.module('focaLogin') |
2 | 2 | .service('focaLoginService', [ |
3 | - '$http', 'API_ENDPOINT', 'APP', | |
4 | - function($http, API_ENDPOINT, APP) { | |
3 | + '$http', 'API_ENDPOINT', 'APP', '$cookies', | |
4 | + function($http, API_ENDPOINT, APP, $cookies) { | |
5 | 5 | return { |
6 | 6 | login: function(usuario) { |
7 | 7 | if (APP) { |
... | ... | @@ -9,6 +9,15 @@ angular.module('focaLogin') |
9 | 9 | } |
10 | 10 | |
11 | 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 | } |