这是一个创建于 1627 天前的主题,其中的信息可能已经有所发展或是发生改变。
export interface AxiosResponse<T = any> {
data: T;
status: number;
statusText: string;
headers: any;
config: AxiosRequestConfig;
request?: any;
}
export interface AxiosError<T = any> extends Error {
config: AxiosRequestConfig;
code?: string;
request?: any;
response?: AxiosResponse<T>;
isAxiosError: boolean;
toJSON: () => object;
}
我取个 headers 还要写 if else
2 条回复 • 2020-10-27 18:56:40 +08:00
 |
|
1
ysc3839 2020-10-27 18:48:22 +08:00 via Android
因为这个 Error 是用作异常 throw 的。
|
 |
|
2
vision1900 2020-10-27 18:56:40 +08:00
出 Error 了有时候可能就没有 response 了,比如断网了 况且 Error 是要 Catch 处理的,把它当作特殊对象无可厚非
|