fix: 微服务版本 区间查询和中文搜索条件一起使用 无法正确查询

This commit is contained in:
dap 2024-12-06 09:27:11 +08:00
parent 827ef2e403
commit 48ca7aca8c
4 changed files with 23 additions and 1 deletions

View File

@ -13,6 +13,7 @@
**BUG FIXES**
- 操作日志详情 在description组件中json预览样式异常
- 微服务版本 区间查询和中文搜索条件一起使用 无法正确查询
# 1.1.2

View File

@ -10,6 +10,7 @@ import {
authenticateResponseInterceptor,
errorMessageResponseInterceptor,
RequestClient,
stringify,
} from '@vben/request';
import { useAccessStore } from '@vben/stores';
@ -94,6 +95,23 @@ function createRequestClient(baseURL: string) {
// 添加全局clientId
config.headers.clientId = clientId;
/**
* get/delete参数
* paramsSerializer则不走此逻辑
*/
if (
['DELETE', 'GET'].includes(config.method?.toUpperCase() || '') &&
config.params &&
!config.paramsSerializer
) {
/**
* 1. (params Map类型参数)key
* 2. arr=1&arr=2&arr=3
*/
config.paramsSerializer = (params) =>
stringify(params, { arrayFormat: 'repeat' });
}
const { encrypt } = config;
// 全局开启请求加密功能 && 该请求开启 && 是post/put请求
if (

View File

@ -22,9 +22,11 @@
"dependencies": {
"@vben/locales": "workspace:*",
"@vben/utils": "workspace:*",
"axios": "catalog:"
"axios": "catalog:",
"qs": "^6.13.1"
},
"devDependencies": {
"@types/qs": "^6.9.17",
"axios-mock-adapter": "catalog:"
}
}

View File

@ -1,2 +1,3 @@
export * from './request-client';
export * from 'axios';
export { stringify } from 'qs';