Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var initStyle = function () {
- if (localStorage['user']) {
- var fromLocal = JSON.parse(localStorage['user']);
- var idUser = fromLocal.idUser;
- var hash = CryptoJS.HmacSHA1(fromLocal.idUser + fromLocal.secret, fromLocal.secret.toString()).toString();
- delete hash.access_token;
- $.ajax({
- type: 'GET',
- url: 'http://localhost:1711/api/css/getStyle',
- // data: sendData,
- // dataType: "html",
- headers: { 'AuthorId': idUser, 'hash': hash },
- beforeSend: function (xhr) {
- var token = fromLocal.secret;
- xhr.setRequestHeader("Authorization", "Bearer " + token);
- },
- statusCode: {
- 200: function (data) {
- //alert(data);
- return JSON.parse(data);
- },
- 404: function () {
- return false;
- }
- }
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement