1234567891011121314151617181920212223242526 |
- // var rootDocment = 'https://sph.wenxingshuju.com/wx_sph';//域名
- var rootDocment = '/wx_sph';//域名
- function req(url, method, data, cb, fail_cb, selfHeader) {
- var dataes = {}
- var header = {'Content-type':'application/json'}
- uni.request({
- url: rootDocment + url,
- data: data ? Object.assign(data, dataes) : dataes,
- method: method,
- header: selfHeader ? Object.assign(selfHeader,header) : header,
- success: function (res) {
- if((res.data.errno == '4002' || res.data.errno == '4001')){
-
- }else{
- return typeof cb == "function" && cb(res.data)
- }
- },
- fail: function (err) {
- return typeof fail_cb == "function" && fail_cb(err)
- }
- })
- }
- module.exports = {
- req: req,
- rootDocment: rootDocment
- }
|