diff --git a/package.json b/package.json index 7acd85f..f8fa785 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bytedo/fetch", - "version": "1.1.0", + "version": "1.1.1", "description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch", "main": "dist/index.js", "directories": { diff --git a/src/index.es7 b/src/index.es7 index 82a10fa..e184565 100644 --- a/src/index.es7 +++ b/src/index.es7 @@ -276,7 +276,7 @@ class _Request { result.statusText = this.xhr.statusText || ERRORS[10500] } - result.body = this.xhr.response + result.body = result.status === 204 ? null : this.xhr.response this.__success__(isSucc, result) }