无木
2021-09-11 656ee4e5c9b363b6ab59aa071915414e5ee95de4
提交 | 用户 | age
4ce1d5 1 export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined;
V 2
2f6253 3 export interface RequestOptions {
a821d9 4   // Splicing request parameters to url
2f6253 5   joinParamsToUrl?: boolean;
a821d9 6   // Format request parameter time
2f6253 7   formatDate?: boolean;
aed622 8   // Whether to process the request result
b6d5b0 9   isTransformResponse?: boolean;
aed622 10   // Whether to return native response headers
V 11   // For example: use this attribute when you need to get the response headers
56d8af 12   isReturnNativeResponse?: boolean;
a821d9 13   // Whether to join url
2f6253 14   joinPrefix?: boolean;
a821d9 15   // Interface address, use the default apiUrl if you leave it blank
2f6253 16   apiUrl?: string;
7df9b5 17   // 请求拼接路径
L 18   urlPrefix?: string;
a821d9 19   // Error message prompt type
4ce1d5 20   errorMessageMode?: ErrorMessageMode;
a821d9 21   // Whether to add a timestamp
f646e3 22   joinTime?: boolean;
3b8ca4 23   ignoreCancelToken?: boolean;
c99cf5 24   // Whether to send token in header
25   withToken?: boolean;
2f6253 26 }
27
28 export interface Result<T = any> {
29   code: number;
30   type: 'success' | 'error' | 'warning';
31   message: string;
32   result: T;
33 }
a821d9 34
V 35 // multipart/form-data: upload file
746d4a 36 export interface UploadFileParams {
a821d9 37   // Other parameters
a98835 38   data?: Recordable;
a821d9 39   // File parameter interface field name
746d4a 40   name?: string;
a821d9 41   // file name
746d4a 42   file: File | Blob;
a821d9 43   // file name
746d4a 44   filename?: string;
661db0 45   [key: string]: any;
746d4a 46 }