公众号请求设置请求编码

This commit is contained in:
sugar1569 2019-02-14 10:28:23 +08:00
parent 01e4017f35
commit 2196e3338f

View File

@ -2,7 +2,7 @@
typeof define == 'function' && define('store',['axios','helper'],factory);
})(this,function(axios,$h){
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
return {
baseGet:function(url,successCallback,errorCallback){
axios.get(url).then(function(res){
@ -418,6 +418,13 @@
p:{limit:limit}
}),successCallback,errorCallback);
},
getPublicProductList:function(p,successCallback,errorCallback){
this.baseGet($h.U({
c:'public_api',
a:'get_product_list',
p:p
}),successCallback,errorCallback);
},
getBestProductList:function(p,successCallback,errorCallback){
this.baseGet($h.U({
c:'public_api',