Skip to content

Commit

Permalink
fix: skipErrorHandler 参数问题
Browse files Browse the repository at this point in the history
  • Loading branch information
winixt committed Dec 14, 2023
1 parent 1794ed7 commit ffb3417
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/fes-plugin-request/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
5 changes: 4 additions & 1 deletion packages/fes-plugin-request/src/template/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit ffb3417

Please sign in to comment.