mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 修复构建后mockjs对xhr的影响问题
This commit is contained in:
26
patches/mockjs+^1.1.0.patch
Normal file
26
patches/mockjs+^1.1.0.patch
Normal file
@ -0,0 +1,26 @@
|
||||
# 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..dcc2fb9 100644
|
||||
--- a/node_modules/mockjs/dist/mock.js
|
||||
+++ b/node_modules/mockjs/dist/mock.js
|
||||
@@ -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
|
||||
}
|
Reference in New Issue
Block a user