fix: 查询条件过滤空条件时, api query参数值的表达式执行结果为date类型时导致参数不生效 (#10325)

This commit is contained in:
yangwei9012 2024-05-28 19:27:21 +08:00 committed by GitHub
parent ccdedcef21
commit 906fa04b34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,7 +144,12 @@ export function buildApi(
(api as ApiObject)?.filterEmptyQuery
? {
filter: (key: string, value: any) => {
return value === '' ? undefined : value;
return value === ''
? undefined
: // qs源码中有filter后不会默认使用serializeDate处理date类型
value instanceof Date
? Date.prototype.toISOString.call(value)
: value;
}
}
: undefined