Showing
1 changed file
with
7 additions
and
2 deletions
@@ -19,7 +19,7 @@ let http = { | @@ -19,7 +19,7 @@ let http = { | ||
19 | }catch (e){ | 19 | }catch (e){ |
20 | } | 20 | } |
21 | }, | 21 | }, |
22 | - post: function (requestUrl, data, callback, errFunc,showLoadding) { | 22 | + post: function (requestUrl, data, callback, errFunc,showLoadding,setToken) { |
23 | if (http.proxy == null) { | 23 | if (http.proxy == null) { |
24 | const {proxy} = Vue.getCurrentInstance() | 24 | const {proxy} = Vue.getCurrentInstance() |
25 | http.proxy = proxy; | 25 | http.proxy = proxy; |
@@ -32,12 +32,14 @@ let http = { | @@ -32,12 +32,14 @@ let http = { | ||
32 | if(showLoadding && showLoadding == true){ | 32 | if(showLoadding && showLoadding == true){ |
33 | loading = http.proxy.$global.showLoading(); | 33 | loading = http.proxy.$global.showLoading(); |
34 | } | 34 | } |
35 | + if(setToken == undefined || setToken == true){ | ||
35 | var access_token = 'access_token=' + http.getToken(); | 36 | var access_token = 'access_token=' + http.getToken(); |
36 | if (requestUrl.indexOf('?') == -1) { | 37 | if (requestUrl.indexOf('?') == -1) { |
37 | requestUrl += '?' + access_token; | 38 | requestUrl += '?' + access_token; |
38 | } else { | 39 | } else { |
39 | requestUrl += '&' + access_token; | 40 | requestUrl += '&' + access_token; |
40 | } | 41 | } |
42 | + } | ||
41 | $.ajax({ | 43 | $.ajax({ |
42 | url: sessionStorage.getItem('domainName') + requestUrl, | 44 | url: sessionStorage.getItem('domainName') + requestUrl, |
43 | method: "post", | 45 | method: "post", |
@@ -69,7 +71,7 @@ let http = { | @@ -69,7 +71,7 @@ let http = { | ||
69 | }); | 71 | }); |
70 | 72 | ||
71 | }, | 73 | }, |
72 | - get: function (requestUrl, data, callback, errFunc,showLoadding) { | 74 | + get: function (requestUrl, data, callback, errFunc,showLoadding,setToken) { |
73 | if (http.proxy == null) { | 75 | if (http.proxy == null) { |
74 | const {proxy} = Vue.getCurrentInstance() | 76 | const {proxy} = Vue.getCurrentInstance() |
75 | http.proxy = proxy; | 77 | http.proxy = proxy; |
@@ -82,12 +84,15 @@ let http = { | @@ -82,12 +84,15 @@ let http = { | ||
82 | if(showLoadding == true){ | 84 | if(showLoadding == true){ |
83 | loading = http.proxy.$global.showLoading(); | 85 | loading = http.proxy.$global.showLoading(); |
84 | } | 86 | } |
87 | + if(setToken == undefined || setToken == true){ | ||
85 | var access_token = 'access_token=' + http.getToken(); | 88 | var access_token = 'access_token=' + http.getToken(); |
86 | if (requestUrl.indexOf('?') == -1) { | 89 | if (requestUrl.indexOf('?') == -1) { |
87 | requestUrl += '?' + access_token; | 90 | requestUrl += '?' + access_token; |
88 | } else { | 91 | } else { |
89 | requestUrl += '&' + access_token; | 92 | requestUrl += '&' + access_token; |
90 | } | 93 | } |
94 | + } | ||
95 | + | ||
91 | $.ajax({ | 96 | $.ajax({ |
92 | url: sessionStorage.getItem('domainName') + requestUrl, | 97 | url: sessionStorage.getItem('domainName') + requestUrl, |
93 | method: "get", | 98 | method: "get", |
-
Please register or login to post a comment