Guest User

Untitled

a guest
Oct 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. use IlluminateSupportFacadesValidator;
  2. use IlluminateHttpRequest;
  3. use AppUser;
  4. use IlluminateSupportFacadesDB;
  5. use AppHttpRequestsPessoaRequest;
  6. use TymonJWTAuthExceptionsJWTException;
  7. use TymonJWTAuthFacadesJWTAuth;
  8.  
  9. class PessoaController extends Controller
  10. {
  11.  
  12. protected $user;
  13.  
  14. public function __construct()
  15. {
  16.  
  17. $this->user = JWTAuth::parseToken()->authenticate();
  18. }
  19. }
  20.  
  21. (function() {
  22. app.controller('MemberController', [
  23. '$scope', '$rootScope', 'AppConfig', '$http',
  24. function($scope, $rootScope, AppConfig, $http) {
  25. var vm = this;
  26. $rootScope.page.title = 'SEC BASE';
  27.  
  28. getMembers();
  29.  
  30. $rootScope.authenticated = true;
  31. $scope.token = $rootScope.user.remember_token;
  32.  
  33. // Obtem a listagem de todos os usuarios
  34. function getMembers() {
  35. $scope.token = $rootScope.user.remember_token;
  36. Loading.show();
  37. $http({
  38. method: 'GET',
  39. url: AppConfig.ApiUrl + 'members'
  40. }).then( response => {
  41. // console.log(response);
  42. $scope.members = response.data;
  43. }).finally(Loading.hide);
  44. }
  45. ]);
  46. })();
Add Comment
Please, Sign In to add comment