diff --git a/packages/fes-plugin-request/package.json b/packages/fes-plugin-request/package.json index 08014f5c..731e3de7 100644 --- a/packages/fes-plugin-request/package.json +++ b/packages/fes-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-request", - "version": "3.0.3", + "version": "3.0.4", "description": "@fesjs/plugin-request", "main": "lib/index.js", "files": [ diff --git a/packages/fes-plugin-request/src/template/request.js b/packages/fes-plugin-request/src/template/request.js index 5a57a093..327a06ff 100644 --- a/packages/fes-plugin-request/src/template/request.js +++ b/packages/fes-plugin-request/src/template/request.js @@ -122,7 +122,10 @@ export const request = (url, data, options = {}) => { return currentRequestInstance.request(context).then(async () => { if (context.config.skipErrorHandler) { console.warn('3.x 已移除 skipErrorHandler 参数,请改用 dataHandler 处理'); - if (context.config.skipErrorHandler === true || context.response?.data?.code === context.config.skipErrorHandler) { + if ( + ((context.error || context.response?.data?.code !== '0') && context.config.skipErrorHandler === true) || + context.response?.data?.code === context.config.skipErrorHandler + ) { return Promise.reject(context.response); } }