fix: logs filter
This commit is contained in:
@@ -16,7 +16,7 @@ class ApiClient {
|
||||
|
||||
constructor() {
|
||||
this.axiosInstance = axios.create({
|
||||
baseURL: "http://10.97.147.99:8080/api/v1",
|
||||
baseURL: "http://213.165.213.170:8080/api/v1",
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -24,6 +24,33 @@ class ApiClient {
|
||||
validateStatus: (status) => {
|
||||
return status >= 200 && status < 400;
|
||||
},
|
||||
// Добавляем кастомный сериализатор параметров
|
||||
paramsSerializer: {
|
||||
serialize: (params) => {
|
||||
const parts: string[] = [];
|
||||
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
if (value === undefined || value === null) return;
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
// Преобразуем массив в множественные параметры: level=info&level=warning
|
||||
value.forEach((item) => {
|
||||
if (item !== undefined && item !== null) {
|
||||
parts.push(
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(item)}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
parts.push(
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return parts.join("&");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.setupInterceptors();
|
||||
|
||||
Reference in New Issue
Block a user