fix error

This commit is contained in:
midfar 2023-03-13 18:11:15 +08:00
parent 2a9202597f
commit b5b8970ab5
2 changed files with 7 additions and 5 deletions

View File

@ -14,10 +14,5 @@ Object.keys(modules).forEach((key) => {
* Used in a production environment. Need to manually import all modules * Used in a production environment. Need to manually import all modules
*/ */
export function setupProdMockServer() { 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); createProdMockServer(mockModules);
} }

View File

@ -177,6 +177,13 @@ export default defineComponent({
// Because if you enter this page and quickly switch tag, may be in the execution of the setTagsViewTitle function, this.$route is no longer pointing to the current page // Because if you enter this page and quickly switch tag, may be in the execution of the setTagsViewTitle function, this.$route is no longer pointing to the current page
// https://github.com/PanJiaChen/vue-element-admin/issues/1221 // https://github.com/PanJiaChen/vue-element-admin/issues/1221
this.tempRoute = Object.assign({}, this.$route); this.tempRoute = Object.assign({}, this.$route);
// https://kgithub.com/nuysoft/Mock/issues/301
// _xhr.upload.addEventListener is not a function
if (window._XMLHttpRequest) {
var xhr = new window._XMLHttpRequest();
window.XMLHttpRequest.prototype.upload = xhr.upload;
}
}, },
methods: { methods: {
fetchData(id) { fetchData(id) {