From 670cb3dc83eeae442889f6878ac37ae524989975 Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Tue, 31 Dec 2019 13:18:51 +0800 Subject: [PATCH] fix #254 --- src/mock/d2-mock/patch/withCredentials.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mock/d2-mock/patch/withCredentials.js b/src/mock/d2-mock/patch/withCredentials.js index 085a9145..160af951 100644 --- a/src/mock/d2-mock/patch/withCredentials.js +++ b/src/mock/d2-mock/patch/withCredentials.js @@ -4,7 +4,10 @@ export default function (Mock) { Mock.XHR.prototype.send = function () { if (this.custom.xhr) { this.custom.xhr.withCredentials = this.withCredentials || false - this.custom.xhr.responseType = this.responseType + // https://github.com/d2-projects/d2-admin/issues/254 + if (!this.custom.async) { + this.custom.xhr.responseType = this.responseType + } } this.__send.apply(this, arguments) }