Commit 3aafe321bff58b10c7f719c1168df6899875499c

Authored by Cleverson Sacramento
1 parent 879c146b
Exists in master

Ajuste no nome do atributo de sessão

archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js
@@ -27,7 +27,7 @@ $(function() { @@ -27,7 +27,7 @@ $(function() {
27 27
28 $("#delete").click(function() { 28 $("#delete").click(function() {
29 if (confirm('Tem certeza que deseja apagar?')) { 29 if (confirm('Tem certeza que deseja apagar?')) {
30 - BookmarkProxy.remove($("#id").val(), removeOk); 30 + BookmarkProxy.remove([$("#id").val()], removeOk);
31 } 31 }
32 }); 32 });
33 33
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js
@@ -24,7 +24,7 @@ function make_base_auth(user, password) { @@ -24,7 +24,7 @@ function make_base_auth(user, password) {
24 // Funções de Callback 24 // Funções de Callback
25 25
26 function loginOk(data) { 26 function loginOk(data) {
27 - sessionStorage.setItem('credential', make_base_auth($("#username").val().trim(), $("#password").val().trim())); 27 + sessionStorage.setItem('credentials', make_base_auth($("#username").val().trim(), $("#password").val().trim()));
28 location.href = "bookmark-list.html"; 28 location.href = "bookmark-list.html";
29 } 29 }
30 30
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js
@@ -31,6 +31,6 @@ AuthProxy.getUser = function($success, $error) { @@ -31,6 +31,6 @@ AuthProxy.getUser = function($success, $error) {
31 }); 31 });
32 }; 32 };
33 33
34 -AuthProxy.getCredential = function(){  
35 - return sessionStorage.getItem('credential'); 34 +AuthProxy.getCredentials = function(){
  35 + return sessionStorage.getItem('credentials');
36 } 36 }
37 \ No newline at end of file 37 \ No newline at end of file
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js
@@ -28,8 +28,8 @@ BookmarkProxy.insert = function($form, $success, $error) { @@ -28,8 +28,8 @@ BookmarkProxy.insert = function($form, $success, $error) {
28 contentType : "application/json", 28 contentType : "application/json",
29 success : $success, 29 success : $success,
30 error : $error, 30 error : $error,
31 - beforeSend: function (xhr) {  
32 - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); 31 + beforeSend : function(xhr) {
  32 + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials());
33 } 33 }
34 }); 34 });
35 }; 35 };
@@ -42,8 +42,8 @@ BookmarkProxy.update = function($id, $form, $success, $error) { @@ -42,8 +42,8 @@ BookmarkProxy.update = function($id, $form, $success, $error) {
42 contentType : "application/json", 42 contentType : "application/json",
43 success : $success, 43 success : $success,
44 error : $error, 44 error : $error,
45 - beforeSend: function (xhr) {  
46 - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); 45 + beforeSend : function(xhr) {
  46 + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials());
47 } 47 }
48 }); 48 });
49 }; 49 };
@@ -56,8 +56,8 @@ BookmarkProxy.remove = function($ids, $success, $error) { @@ -56,8 +56,8 @@ BookmarkProxy.remove = function($ids, $success, $error) {
56 contentType : "application/json", 56 contentType : "application/json",
57 success : $success, 57 success : $success,
58 error : $error, 58 error : $error,
59 - beforeSend: function (xhr) {  
60 - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); 59 + beforeSend : function(xhr) {
  60 + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials());
61 } 61 }
62 }); 62 });
63 }; 63 };