From 05b3ae2f43d8a40779ce9f31ae625a7e046db67a Mon Sep 17 00:00:00 2001 From: Alfred Huang <57082212@qq.com> Date: Thu, 20 Apr 2017 00:13:02 +0800 Subject: [PATCH] Improvement: Status cod 201 should be allowed Some RESTful backend interface returns status code 201 for successful created requests. So 201-299 should be considered as success, not only 200. --- src/modules/image/dashboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/image/dashboard.js b/src/modules/image/dashboard.js index e5b2a7e..d0148e4 100644 --- a/src/modules/image/dashboard.js +++ b/src/modules/image/dashboard.js @@ -151,7 +151,7 @@ export default { } xhr.onload = () => { - if (xhr.status !== 200) { + if (xhr.status >= 300) { this.setUploadError(`request error,code ${xhr.status}`) return } @@ -186,4 +186,4 @@ export default { xhr.send(formData) } } -} \ No newline at end of file +}