添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接
This commit is contained in:
@ -28,9 +28,11 @@ service.interceptors.request.use(config => {
|
||||
if (value !== null && typeof(value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
let params = propName + '[' + key + ']';
|
||||
var subPart = encodeURIComponent(params) + "=";
|
||||
url += subPart + encodeURIComponent(value[key]) + "&";
|
||||
if (value[key] !== null && typeof (value[key]) !== 'undefined') {
|
||||
let params = propName + '[' + key + ']'
|
||||
let subPart = encodeURIComponent(params) + '='
|
||||
url += subPart + encodeURIComponent(value[key]) + '&'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
url += part + encodeURIComponent(value) + "&";
|
||||
|
Reference in New Issue
Block a user