Commit f1d90264e16a987173ba18a54e4eadcc07e293d5

Authored by yvan.ni
1 parent 6470e352

json_post的公用函数

Showing 1 changed file with 2 additions and 2 deletions
utils/request.js
@@ -211,7 +211,7 @@ module.exports = { @@ -211,7 +211,7 @@ module.exports = {
211 setTimeout(function () { 211 setTimeout(function () {
212 if(req) req.abort(); 212 if(req) req.abort();
213 },time*1000) 213 },time*1000)
214 - } 214 + },
215 215
216 /** 216 /**
217 * @param {Object} url //url地址 217 * @param {Object} url //url地址
@@ -221,7 +221,7 @@ module.exports = { @@ -221,7 +221,7 @@ module.exports = {
221 */ 221 */
222 json_post:function(url,data,succ,fail){ 222 json_post:function(url,data,succ,fail){
223 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; 223 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url;
224 - var str = JSON.stringify(pdata); 224 + var str = JSON.stringify(data);
225 wx.request({ 225 wx.request({
226 url: url, 226 url: url,
227 data: str, 227 data: str,