1234567891011121314151617181920 |
- var rootDocment = 'https://tbk.726p.com';//域名
- // var header = {'source':'3000'}
- var header = {}
- function req(url, method, userInfo, data, cb) {
- wx.request({
- url: rootDocment + url,
- data: data,
- method: method,
- header: Object.assign(userInfo,header),
- success: function (res) {
- return typeof cb == "function" && cb(res.data)
- },
- fail: function () {
- return typeof cb == "function" && cb("请求错误")
- }
- })
- }
- module.exports = {
- req: req
- }
|