mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2026-05-26 02:03:22 +08:00
fix(projects): fix ts and lint error
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import axios, { AxiosError } from 'axios';
|
import { create, AxiosError } from 'axios';
|
||||||
import type { AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';
|
import type { AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';
|
||||||
import axiosRetry from 'axios-retry';
|
import axiosRetry from 'axios-retry';
|
||||||
import { nanoid } from '@sa/utils';
|
import { nanoid } from '@sa/utils';
|
||||||
@@ -22,7 +22,7 @@ function createCommonRequest<
|
|||||||
const opts = createDefaultOptions<ResponseData, ApiData, State>(options);
|
const opts = createDefaultOptions<ResponseData, ApiData, State>(options);
|
||||||
|
|
||||||
const axiosConf = createAxiosConfig(axiosConfig);
|
const axiosConf = createAxiosConfig(axiosConfig);
|
||||||
const instance = axios.create(axiosConf);
|
const instance = create(axiosConf);
|
||||||
|
|
||||||
const abortControllerMap = new Map<string, AbortController>();
|
const abortControllerMap = new Map<string, AbortController>();
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function transformResponse(response: AxiosResponse) {
|
|||||||
const responseType: ResponseType = (response.config?.responseType as ResponseType) || 'json';
|
const responseType: ResponseType = (response.config?.responseType as ResponseType) || 'json';
|
||||||
if (responseType === 'json') return;
|
if (responseType === 'json') return;
|
||||||
|
|
||||||
const isJson = response.headers['content-type']?.includes('application/json');
|
const isJson = (response.headers['content-type'] as string)?.includes('application/json');
|
||||||
if (!isJson) return;
|
if (!isJson) return;
|
||||||
|
|
||||||
if (responseType === 'blob') {
|
if (responseType === 'blob') {
|
||||||
|
|||||||
Reference in New Issue
Block a user