Pre Merge pull request !93 from hjaa/master
This commit is contained in:
commit
7ce0744598
|
|
@ -182,8 +182,19 @@ export function tansParams(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]) + '&'
|
||||
if(key != 'params'){
|
||||
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'
|
||||
}
|
||||
if(key === 'params'){
|
||||
let p = params[key];
|
||||
Object.keys(p).forEach((k) => {
|
||||
if(!Object.is(p[k], undefined) && !Object.is(p[k], null)){
|
||||
result += encodeURIComponent(key) + encodeURIComponent('[') + encodeURIComponent(k) + encodeURIComponent(']') + '=' + encodeURIComponent(p[k]) + '&'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue