!32 [inula-request]<feat> 请求组件支持在响应体中获取完整 URL
Merge pull request !32 from 涂旭辉/master
This commit is contained in:
commit
4481c9f241
|
@ -110,6 +110,7 @@ export const fetchRequest = (config: IrRequestConfig): Promise<IrResponse> => {
|
|||
headers: headersObj,
|
||||
config,
|
||||
request: null,
|
||||
responseURL: response.url
|
||||
};
|
||||
|
||||
const responseBody = onDownloadProgress
|
||||
|
|
|
@ -98,6 +98,7 @@ export const ieFetchRequest = (config: IrRequestConfig): Promise<IrResponse> =>
|
|||
headers: response.headers,
|
||||
config,
|
||||
request: null,
|
||||
responseURL: response.url
|
||||
};
|
||||
|
||||
// 根据 responseType 选择相应的解析方法
|
||||
|
|
|
@ -74,7 +74,8 @@ function processUploadProgress(
|
|||
statusText: xhr.statusText,
|
||||
headers: xhr.getAllResponseHeaders(),
|
||||
config: config,
|
||||
}
|
||||
request: xhr
|
||||
};
|
||||
|
||||
if (config.validateStatus!(xhr.status)) {
|
||||
// 如果 fetch 请求已经成功或者拒绝,则此处不生效
|
||||
|
|
|
@ -95,6 +95,9 @@ export type IrResponse<T = any> = {
|
|||
|
||||
// 响应事件消息
|
||||
event?: string;
|
||||
|
||||
// 响应对象上的完整 URL
|
||||
responseURL?: string;
|
||||
};
|
||||
|
||||
// Ir 类接口类型
|
||||
|
|
Loading…
Reference in New Issue