background
There is no problem in the local development environment test, but the deployment server reports an error after packaging.
This problem is caused by mockjs changing the XMLHttpRequest object in axios.
Try the three solutions
Modify method 1
Add about line 8312 of the node_modules/mockjs/dist/mock.js file
MockXMLHttpRequest.prototype.upload = xhr.upload;
Add a native xhr.upload method to the MockXMLHttpRequest object.
Modify method 2
Also modify line 216 of node_modules/mockjs/src/xhr/xhr.js, about line 8312 of node_modules/mockjs/dist/mock.js file
Add
MockXMLHttpRequest.prototype.upload = xhr.upload;
Add a native xhr.upload method to the MockXMLHttpRequest object.
Modify method 3
Uninstall mockjs and delete related codes
npm uninstall mockjs
view.config.js
Comment this code
src/main.js
comment this code