0508修改
This commit is contained in:
@@ -14,6 +14,12 @@ const request = (option: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export interface DownloadResponseData {
|
||||
data: Blob
|
||||
fileName?: string
|
||||
}
|
||||
|
||||
export default {
|
||||
get: async <T = any>(option: any) => {
|
||||
const res = await request({ method: 'GET', ...option })
|
||||
@@ -35,9 +41,9 @@ export default {
|
||||
const res = await request({ method: 'PUT', ...option })
|
||||
return res.data as unknown as T
|
||||
},
|
||||
download: async <T = any>(option: any) => {
|
||||
download: async <T = DownloadResponseData>(option: any) => {
|
||||
const res = await request({ method: 'GET', responseType: 'blob', ...option })
|
||||
return res as unknown as Promise<T>
|
||||
return res as T
|
||||
},
|
||||
upload: async <T = any>(option: any) => {
|
||||
option.headersType = 'multipart/form-data'
|
||||
|
||||
Reference in New Issue
Block a user