From 3aafe321bff58b10c7f719c1168df6899875499c Mon Sep 17 00:00:00 2001 From: Cleverson Sacramento Date: Fri, 27 Jun 2014 15:10:38 -0300 Subject: [PATCH] Ajuste no nome do atributo de sessão --- archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js | 2 +- archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js | 2 +- archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js | 4 ++-- archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js index 02838b8..eb2fc64 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js @@ -27,7 +27,7 @@ $(function() { $("#delete").click(function() { if (confirm('Tem certeza que deseja apagar?')) { - BookmarkProxy.remove($("#id").val(), removeOk); + BookmarkProxy.remove([$("#id").val()], removeOk); } }); diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js index cf979b3..9995307 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js +++ b/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) { // Funções de Callback function loginOk(data) { - sessionStorage.setItem('credential', make_base_auth($("#username").val().trim(), $("#password").val().trim())); + sessionStorage.setItem('credentials', make_base_auth($("#username").val().trim(), $("#password").val().trim())); location.href = "bookmark-list.html"; } diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js index 80ce8ae..c156cf4 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js +++ b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js @@ -31,6 +31,6 @@ AuthProxy.getUser = function($success, $error) { }); }; -AuthProxy.getCredential = function(){ - return sessionStorage.getItem('credential'); +AuthProxy.getCredentials = function(){ + return sessionStorage.getItem('credentials'); } \ No newline at end of file diff --git a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js b/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js index c178efc..673b3f5 100644 --- a/archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js +++ b/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) { contentType : "application/json", success : $success, error : $error, - beforeSend: function (xhr) { - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); + beforeSend : function(xhr) { + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); } }); }; @@ -42,8 +42,8 @@ BookmarkProxy.update = function($id, $form, $success, $error) { contentType : "application/json", success : $success, error : $error, - beforeSend: function (xhr) { - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); + beforeSend : function(xhr) { + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); } }); }; @@ -56,8 +56,8 @@ BookmarkProxy.remove = function($ids, $success, $error) { contentType : "application/json", success : $success, error : $error, - beforeSend: function (xhr) { - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); + beforeSend : function(xhr) { + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); } }); }; -- libgit2 0.21.2