diff --git a/src/mock/d2-mock/patch/withCredentials.js b/src/mock/d2-mock/patch/withCredentials.js index 71a65a32..085a9145 100644 --- a/src/mock/d2-mock/patch/withCredentials.js +++ b/src/mock/d2-mock/patch/withCredentials.js @@ -2,7 +2,10 @@ export default function (Mock) { // http://cnine.me/note/FrontEnd/mock-lose-cookies-dbg.html Mock.XHR.prototype.__send = Mock.XHR.prototype.send Mock.XHR.prototype.send = function () { - if (this.custom.xhr) this.custom.xhr.withCredentials = this.withCredentials || false + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + this.custom.xhr.responseType = this.responseType + } this.__send.apply(this, arguments) } }