Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/mock/xhr/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ Util.extend(MockXMLHttpRequest.prototype, {

// 原生 XHR
if (!this.match) {
// 修复timeout和withCredentials不生效的问题
Util.extend(that.custom.xhr, {
timeout: that.timeout,
withCredentials: that.withCredentials
});

this.custom.xhr.send(data)
return
}
Expand Down Expand Up @@ -439,4 +445,4 @@ function convert(item, options) {
item.template(options) : MockXMLHttpRequest.Mock.mock(item.template)
}

module.exports = MockXMLHttpRequest
module.exports = MockXMLHttpRequest