fix: 查询时空字符串问题

This commit is contained in:
猿小天
2023-07-12 21:34:57 +08:00
parent dcdc7bbe3b
commit 1ccfd619f3

View File

@@ -22,15 +22,19 @@ function createService() {
}, },
paramsSerializer: { paramsSerializer: {
serialize(params) { serialize(params) {
return qs.stringify(params, { interface paramsObj {
indices: false, [key: string]: any;
encoder: (val: string) => { }
if (typeof val === 'boolean') { let result:paramsObj = {};
return val ? 'True' : 'False'; for (const [key, value] of Object.entries(params)) {
} if (value !== '') {
return val; result[key] = value;
}, }
}); if(typeof value === 'boolean'){
result[key] = value? 'True': 'False';
}
}
return qs.stringify(result);
}, },
}, },
}); });