error fix

This commit is contained in:
midfar 2023-03-13 18:06:46 +08:00
parent a8d0b2dc7c
commit 2a9202597f

View File

@ -14,5 +14,10 @@ Object.keys(modules).forEach((key) => {
* Used in a production environment. Need to manually import all modules
*/
export function setupProdMockServer() {
// https://kgithub.com/nuysoft/Mock/issues/301
// 避免 _xhr.upload.addEventListener is not a function
var xhr = new window._XMLHttpRequest();
window.XMLHttpRequest.prototype.upload = xhr.upload;
createProdMockServer(mockModules);
}