mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-11-30 10:48:12 +08:00
Merge branch 'master' of https://github.com/WeBankFinTech/fes.js
This commit is contained in:
commit
f69189aacb
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fesjs/plugin-request",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "@fesjs/plugin-request",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
|
@ -163,7 +163,7 @@ function handleRequestError({
|
||||
}
|
||||
|
||||
if (!skipObj[errorKey] && errorHandler[errorKey]) {
|
||||
errorHandler[errorKey](error);
|
||||
return errorHandler[errorKey](error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,11 +179,11 @@ export const request = (url, data, options = {}) => {
|
||||
const userConfig = userConfigHandler(url, data, options);
|
||||
const context = createContext(userConfig);
|
||||
|
||||
return currentRequestInstance.request(context).then(() => {
|
||||
return currentRequestInstance.request(context).then(async () => {
|
||||
if (!context.error) {
|
||||
return context.config.useResonse ? context.response : context.response.data;
|
||||
}
|
||||
handleRequestError(context);
|
||||
await handleRequestError(context);
|
||||
return Promise.reject(context.error);
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user