You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
728 B

var util = {}
util.data = {}
util.data.base_url = 'https://dbqb.nfdxy.net/devApi'
// util.data.base_url = 'https://dbqb.nfdxy.net/prodApi'
// AJAX 请求方法
util.request = (url, callback, data = {}, failCallback) => {
url = util.data.base_url + url
console.log('请求该接口->', url,'请求参数为->',data);
uni.request({
url: url, //仅为示例,并非真实接口地址。
data,
method: 'post',
header: {
'content-type': 'application/json',
'version': uni.getSystemInfoSync().appVersion,
'client': uni.getSystemInfoSync().platform == 'ios' ? 'ios' : 'android',
'token': uni.getStorageSync('token')
},
sslVerify: false,
success: callback,
fail: failCallback
});
}
export default util