From 199db218afbed71fdbc61f0ffd20fff415514f02 Mon Sep 17 00:00:00 2001 From: zyn Date: Fri, 21 Jul 2023 09:39:17 +0800 Subject: [PATCH] =?UTF-8?q?pc=E7=AB=AF=E8=B7=B3=E8=BD=AC=E5=8F=96=E6=B6=88?= =?UTF-8?q?loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main.js b/src/main.js index de550171a..0ecb50f39 100644 --- a/src/main.js +++ b/src/main.js @@ -73,15 +73,20 @@ router.beforeEach(function (to, from, next) { // const endUrl = currentURL.slice(index + 2) // window.location.href = startUrl + endUrl // } - let loading = Loading.service({ - text: '加载中...', - background: '#fff' - }); + closeLoading() + if (isMobile()){ + var loading = Loading.service({ + text: '加载中...', + background: '#fff' + }); + } function closeLoading(){ - setTimeout(() => { - loading.close() - loading = null - }, 3000) + if (loading) { + setTimeout(() => { + loading.close() + loading = null + }, 3000) + } } let fromName = from.name if(fromName === undefined || fromName === null){ @@ -261,7 +266,7 @@ router.beforeEach(function (to, from, next) { closeLoading() }else { - console.log('-bussLibrary4-') + console.log('-pc端-') extractedVerify() } } @@ -281,7 +286,7 @@ router.beforeEach(function (to, from, next) { closeLoading() } }else { - console.log('-phoneBussLibrary4-') + console.log('-phone端-') next() closeLoading() }