From 612ccabc1c6bf1432b61c5bc4575051642681846 Mon Sep 17 00:00:00 2001 From: xh <11675084@qq.com> Date: Wed, 22 Oct 2025 19:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=A9=BA=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E4=B8=BA=E7=A9=BA=E5=90=8E=E7=AB=AF=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/config/axios/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/config/axios/index.ts b/web/src/config/axios/index.ts index 07719a2..3659eda 100644 --- a/web/src/config/axios/index.ts +++ b/web/src/config/axios/index.ts @@ -16,6 +16,13 @@ const request = (option: any) => { } export default { get: async (option: any) => { + // 过滤空值,解决查询时间范围为空后端报错的问题 + option.params = option.params || {} + Object.keys(option.params).forEach((key) => { + if (option.params[key] === undefined || option.params[key] === null) { + delete option.params[key] + } + }) const res = await request({ method: 'GET', ...option }) return res.data as unknown as T },