pc端跳转取消loading

This commit is contained in:
zyn
2023-07-21 09:39:17 +08:00
parent e9c883b820
commit 199db218af
+8 -3
View File
@@ -73,16 +73,21 @@ router.beforeEach(function (to, from, next) {
// const endUrl = currentURL.slice(index + 2) // const endUrl = currentURL.slice(index + 2)
// window.location.href = startUrl + endUrl // window.location.href = startUrl + endUrl
// } // }
let loading = Loading.service({ closeLoading()
if (isMobile()){
var loading = Loading.service({
text: '加载中...', text: '加载中...',
background: '#fff' background: '#fff'
}); });
}
function closeLoading(){ function closeLoading(){
if (loading) {
setTimeout(() => { setTimeout(() => {
loading.close() loading.close()
loading = null loading = null
}, 3000) }, 3000)
} }
}
let fromName = from.name let fromName = from.name
if(fromName === undefined || fromName === null){ if(fromName === undefined || fromName === null){
window.sessionStorage.clear() window.sessionStorage.clear()
@@ -261,7 +266,7 @@ router.beforeEach(function (to, from, next) {
closeLoading() closeLoading()
}else { }else {
console.log('-bussLibrary4-') console.log('-pc端-')
extractedVerify() extractedVerify()
} }
} }
@@ -281,7 +286,7 @@ router.beforeEach(function (to, from, next) {
closeLoading() closeLoading()
} }
}else { }else {
console.log('-phoneBussLibrary4-') console.log('-phone端-')
next() next()
closeLoading() closeLoading()
} }