From dec149ef0ff4fa779dcefa14ed912bc9b0f62491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 2 Apr 2021 14:30:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D204=E6=97=B6response=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.es7 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) }