|
@ -20,7 +20,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { |
|
|
|
|
|
|
|
|
uni.request({ |
|
|
uni.request({ |
|
|
url: Vue.prototype.$config.baseUrl + uri, |
|
|
url: Vue.prototype.$config.baseUrl + uri, |
|
|
data: enhanceData(data), |
|
|
|
|
|
|
|
|
data, |
|
|
method: method, |
|
|
method: method, |
|
|
header: { |
|
|
header: { |
|
|
'X-Access-Token': uni.getStorageSync('token'), |
|
|
'X-Access-Token': uni.getStorageSync('token'), |
|
@ -71,16 +71,6 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { |
|
|
return promise |
|
|
return promise |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function enhanceData(data) { |
|
|
|
|
|
const userid = uni.getStorageSync("userid") |
|
|
|
|
|
if (!data) { |
|
|
|
|
|
data = {} |
|
|
|
|
|
} |
|
|
|
|
|
if (userid) { |
|
|
|
|
|
data.userid = userid |
|
|
|
|
|
} |
|
|
|
|
|
return data |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
http: http, |
|
|
http: http, |