返回微信小商城共用......登陆

微信小商城共用接口数据请求

phpcn_u562852019-02-23 21:35:02266

var requestUrl = "http://tp51.io/api.php/";


function post(url, data, fun, that) {

if (url == 'undefined') {

return false;

}

var postUrl = requestUrl + url;

wx.request({

url: postUrl,

data: data,

method: "POST",

dataType: "json",

header: {

'content-type': 'application/json'

},

success: function (res) {

that[fun](res.data.result);

},

fail: function (res) {

console.log('请求失败,请重试');

return {};

}

})

}


module.exports.post=post;


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送