Commit 14fe8223 authored by liaozan's avatar liaozan 🏀

chore: add loading

parent fda4f68c
<!--suppress JSCheckFunctionSignatures -->
<template> <template>
<div id="form" class="form"> <div id="form" class="form">
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
<script> <script>
import axios from '../util/request' import axios from '../util/request'
import {ElMessageBox} from 'element-plus'
export default { export default {
name: "BackendStarter", name: "BackendStarter",
...@@ -60,17 +62,20 @@ export default { ...@@ -60,17 +62,20 @@ export default {
const blob = new Blob([data]) const blob = new Blob([data])
const link = document.createElement('a'); const link = document.createElement('a');
link.style.display = "none"; link.style.display = "none";
link.href = window.URL.createObjectURL(blob); link.href = URL.createObjectURL(blob);
link.download = fileName; link.download = fileName;
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
window.URL.revokeObjectURL(link.href); URL.revokeObjectURL(link.href);
document.body.removeChild(link); document.body.removeChild(link);
}, error => { }, error => {
const reader = new FileReader(); const reader = new FileReader();
reader.readAsText(error.data, 'utf-8'); reader.readAsText(error.data, 'utf-8');
reader.onload = function (e) { reader.onload = function () {
alert(reader.result) ElMessageBox.alert(JSON.parse(reader.result).message, '提示', {
confirmButtonText: '确定'
}
)
} }
}) })
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment