update .gitignore
This commit is contained in:
12
http/http.js
12
http/http.js
@@ -125,7 +125,7 @@ function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||
|
||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||
function request(args) {
|
||||
const {
|
||||
let {
|
||||
url,
|
||||
data,
|
||||
params,
|
||||
@@ -133,6 +133,16 @@ function request(args) {
|
||||
showLoading = true,
|
||||
extParams = {}
|
||||
} = args
|
||||
if (params) {
|
||||
let result = ''
|
||||
Object.keys(params).forEach((key) => {
|
||||
if (!Object.is(params[key], undefined) && !Object.is(params[key], null) && !Object.is(JSON.stringify(params[key]), '{}')) {
|
||||
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
||||
}
|
||||
})
|
||||
url = url+'?'+result
|
||||
params = null
|
||||
}
|
||||
let headerObject = {}
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
|
||||
Reference in New Issue
Block a user