|
|
@ -72,22 +72,20 @@ service.interceptors.response.use(res => { |
|
|
|
|
|
|
|
axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if(config.baseURL){ |
|
|
|
config.url=config.baseURL+'/'+config.url |
|
|
|
} |
|
|
|
|
|
|
|
console.log(config) |
|
|
|
var settle = require('axios/lib/core/settle'); |
|
|
|
var buildURL = require('axios/lib/helpers/buildURL'); |
|
|
|
uni.request({ |
|
|
|
method: config.method.toUpperCase(), |
|
|
|
url: config.baseURL + buildURL(config.url, config.params, config.paramsSerializer), |
|
|
|
url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer), |
|
|
|
header: config.headers, |
|
|
|
data: config.data, |
|
|
|
dataType: config.dataType, |
|
|
|
responseType: config.responseType, |
|
|
|
sslVerify: config.sslVerify, |
|
|
|
complete: function complete(response) { |
|
|
|
console.log("执行完成:",config.baseURL + buildURL(config.url, config.params, config.paramsSerializer),response.data) |
|
|
|
console.log("执行完成:",config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),response.data) |
|
|
|
response = { |
|
|
|
data: response.data, |
|
|
|
status: response.statusCode, |
|
|
|