mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 21:50:35 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fe088174d | |||
| 515638c063 | |||
| 9b48671dcd | |||
| debec2e236 |
@@ -1,5 +1,6 @@
|
|||||||
import { initClient, initContract } from '@ts-rest/core';
|
import { initClient, initContract } from '@ts-rest/core';
|
||||||
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse, isAxiosError } from 'axios';
|
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse, isAxiosError } from 'axios';
|
||||||
|
import omitBy from 'lodash/omitBy';
|
||||||
import qs from 'qs';
|
import qs from 'qs';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
@@ -379,26 +380,8 @@ axiosClient.interceptors.response.use(
|
|||||||
const parsePath = (fullPath: string) => {
|
const parsePath = (fullPath: string) => {
|
||||||
const [path, params] = fullPath.split('?');
|
const [path, params] = fullPath.split('?');
|
||||||
|
|
||||||
const url = new URLSearchParams(params);
|
const parsedParams = qs.parse(params, { arrayLimit: 99999, parameterLimit: 99999 });
|
||||||
const notNilParams: Record<string, string[]> = {};
|
const notNilParams = omitBy(parsedParams, (value) => value === 'undefined' || value === 'null');
|
||||||
|
|
||||||
for (const [key, value] of url) {
|
|
||||||
if (value === 'undefined' || value === 'null') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let realKey = key;
|
|
||||||
|
|
||||||
if (key.includes('[') && key.includes(']')) {
|
|
||||||
realKey = key.split('[')[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (realKey in notNilParams) {
|
|
||||||
notNilParams[realKey].push(value);
|
|
||||||
} else {
|
|
||||||
notNilParams[realKey] = [value];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
params: notNilParams,
|
params: notNilParams,
|
||||||
|
|||||||
@@ -146,7 +146,6 @@ export const ThemeSettings = memo(() => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
renderOption={renderThemeOption}
|
renderOption={renderThemeOption}
|
||||||
searchable
|
|
||||||
width={240}
|
width={240}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user