修复204时response的异常

master
宇天 2021-04-02 14:30:53 +08:00
parent 6a7099ad2e
commit dec149ef0f
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@bytedo/fetch", "name": "@bytedo/fetch",
"version": "1.1.0", "version": "1.1.1",
"description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch", "description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch",
"main": "dist/index.js", "main": "dist/index.js",
"directories": { "directories": {

View File

@ -276,7 +276,7 @@ class _Request {
result.statusText = this.xhr.statusText || ERRORS[10500] 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) this.__success__(isSucc, result)
} }