|
|
@ -16,6 +16,13 @@ const request = (option: any) => { |
|
|
} |
|
|
} |
|
|
export default { |
|
|
export default { |
|
|
get: async <T = any>(option: any) => { |
|
|
get: async <T = any>(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 }) |
|
|
const res = await request({ method: 'GET', ...option }) |
|
|
return res.data as unknown as T |
|
|
return res.data as unknown as T |
|
|
}, |
|
|
}, |
|
|
|