36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
# generated by patch-package 6.4.14
|
|
#
|
|
# declared package:
|
|
# mockjs: ^1.1.0
|
|
#
|
|
diff --git a/node_modules/mockjs/dist/mock.js b/node_modules/mockjs/dist/mock.js
|
|
index 35d5b9a..3e6a52e 100644
|
|
--- a/node_modules/mockjs/dist/mock.js
|
|
+++ b/node_modules/mockjs/dist/mock.js
|
|
@@ -8264,7 +8264,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
Util.extend(MockXMLHttpRequest.prototype, {
|
|
// https://xhr.spec.whatwg.org/#the-open()-method
|
|
// Sets the request method, request URL, and synchronous flag.
|
|
- open: function(method, url, async, username, password) {
|
|
+ open: function(method, url, async = true, username, password) {
|
|
var that = this
|
|
|
|
Util.extend(this.custom, {
|
|
@@ -8310,6 +8310,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
var xhr = createNativeXMLHttpRequest()
|
|
this.custom.xhr = xhr
|
|
|
|
+ MockXMLHttpRequest.prototype.upload = xhr.upload
|
|
+
|
|
// 初始化所有事件,用于监听原生 XHR 对象的事件
|
|
for (var i = 0; i < XHR_EVENTS.length; i++) {
|
|
xhr.addEventListener(XHR_EVENTS[i], handle)
|
|
@@ -8360,6 +8362,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
// 原生 XHR
|
|
if (!this.match) {
|
|
+ this.custom.xhr.responseType = this.responseType || ''
|
|
this.custom.xhr.send(data)
|
|
return
|
|
}
|