添加了蒙层

This commit is contained in:
luyuan 2020-11-02 16:11:45 +08:00
parent 8656e75e16
commit 8177140705
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 18 additions and 0 deletions

View File

@ -61,6 +61,19 @@
}
})(1366, 1024);
</script>
<style>
#make{
background-color: #000;
opacity: 0.5;
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 999;
display: none;
}
</style>
</head>
<body>
@ -69,6 +82,7 @@
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<div id="make"></div>
<!-- built files will be auto injected -->
<script>
window.fbAsyncInit = function () {

View File

@ -13,9 +13,11 @@ export interface Get {
}
let login: MessageType;
let count = 0;
const div: any = document.getElementById("make");
axios.interceptors.request.use((config)=>{
if(count == 0){
login = message.loading('加载中..', 0)
div.style.display = "block"
}
count++;
return config;
@ -28,6 +30,7 @@ axios.interceptors.response.use((response)=>{
count--;
if(count == 0){
login();
div.style.display = "none"
}
console.log(count)
}, 1000)
@ -44,6 +47,7 @@ axios.interceptors.response.use((response)=>{
count--;
if(count == 0){
login();
div.style.display = "none"
}
console.log(count)
}, 1000)