|
@@ -1,15 +1,41 @@
|
|
|
-declare interface AxiosResponse<T = any> {
|
|
|
- data: T;
|
|
|
- status: number;
|
|
|
- statusText: string;
|
|
|
- headers: {
|
|
|
- [key: string]: string;
|
|
|
- 'content-type'?: string;
|
|
|
- };
|
|
|
- config: {
|
|
|
- method?: string;
|
|
|
- url?: string;
|
|
|
- params?: Record<string, any>;
|
|
|
- headers?: Record<string, any>;
|
|
|
- };
|
|
|
+// types/global.d.ts
|
|
|
+declare global {
|
|
|
+ interface AxiosResponse<T = any> {
|
|
|
+ data: ApiResponseData<T>;
|
|
|
+ status: number;
|
|
|
+ statusText: string;
|
|
|
+ headers: {
|
|
|
+ [key: string]: string;
|
|
|
+ 'content-type'?: string;
|
|
|
+ };
|
|
|
+ config: {
|
|
|
+ method?: string;
|
|
|
+ url?: string;
|
|
|
+ params?: Record<string, any>;
|
|
|
+ headers?: Record<string, any>;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ interface ApiResponse<T = any> {
|
|
|
+ data: ApiResponseData<T>;
|
|
|
+ status: number;
|
|
|
+ statusText: string;
|
|
|
+ headers: {
|
|
|
+ [key: string]: string;
|
|
|
+ 'content-type'?: string;
|
|
|
+ };
|
|
|
+ config: {
|
|
|
+ method?: string;
|
|
|
+ url?: string;
|
|
|
+ params?: Record<string, any>;
|
|
|
+ headers?: Record<string, any>;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ interface ApiResponseData<T = any> {
|
|
|
+ code: number;
|
|
|
+ msg: string;
|
|
|
+ success: boolean;
|
|
|
+ data: T;
|
|
|
+ }
|
|
|
}
|