首页 > 微信 > 详细

微信小程序封装请求接口

时间:2019-09-07 09:49:32      阅读:257      评论:0      收藏:0      [点我收藏+]
var rootDocment = ‘https://123.com‘;//你的域名
function postData(url, data, cb) {

wx.request({

      url: rootDocment + url,
      data: data,
      method: ‘post‘,
      success: function (res) {
        return typeof cb == "function" && cb(res)
      },
      fail: function () {
        return typeof cb == "function" && cb(false)
      }
    })
}
技术分享图片

 

 

微信小程序封装请求接口

原文:https://www.cnblogs.com/caoyuna/p/11478786.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!