fix: logs filter

This commit is contained in:
2026-04-05 00:13:09 +03:00
parent bcca8fa298
commit 43ea41f633
5 changed files with 59 additions and 24 deletions
+28 -1
View File
@@ -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();