Commit 5d9ded8902846eeacf6063a6b6ebc366ac982096
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !4
Showing
1 changed file
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 | } |