mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
perf: format code with better style (#5283)
This commit is contained in:
@@ -11,7 +11,7 @@ class FileUploader {
|
||||
|
||||
public async upload(
|
||||
url: string,
|
||||
data: { file: Blob | File } & Record<string, any>,
|
||||
data: Record<string, any> & { file: Blob | File },
|
||||
config?: AxiosRequestConfig,
|
||||
): Promise<AxiosResponse> {
|
||||
const formData = new FormData();
|
||||
|
@@ -5,6 +5,8 @@ import type {
|
||||
CreateAxiosDefaults,
|
||||
} from 'axios';
|
||||
|
||||
import type { RequestClientOptions } from './types';
|
||||
|
||||
import { bindMethods, merge } from '@vben/utils';
|
||||
|
||||
import axios from 'axios';
|
||||
@@ -12,20 +14,19 @@ import axios from 'axios';
|
||||
import { FileDownloader } from './modules/downloader';
|
||||
import { InterceptorManager } from './modules/interceptor';
|
||||
import { FileUploader } from './modules/uploader';
|
||||
import { type RequestClientOptions } from './types';
|
||||
|
||||
class RequestClient {
|
||||
private readonly instance: AxiosInstance;
|
||||
|
||||
public addRequestInterceptor: InterceptorManager['addRequestInterceptor'];
|
||||
public addResponseInterceptor: InterceptorManager['addResponseInterceptor'];
|
||||
|
||||
public addResponseInterceptor: InterceptorManager['addResponseInterceptor'];
|
||||
public download: FileDownloader['download'];
|
||||
|
||||
// 是否正在刷新token
|
||||
public isRefreshing = false;
|
||||
// 刷新token队列
|
||||
public refreshTokenQueue: ((token: string) => void)[] = [];
|
||||
public upload: FileUploader['upload'];
|
||||
private readonly instance: AxiosInstance;
|
||||
|
||||
/**
|
||||
* 构造函数,用于创建Axios实例
|
||||
|
Reference in New Issue
Block a user