From f1d3ad7dc921b845e64d0279a2b07c0c4d213833 Mon Sep 17 00:00:00 2001 From: Wayne Date: Wed, 6 Dec 2023 09:48:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=B1=E7=89=87=E5=BB=A3=E5=91=8Abug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home/index.vue | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index fab089d..1169d5f 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -113,7 +113,7 @@ onBeforeMount(async () => { router.push("/login"); } } - + await userStore.getUserData(); await cardStore.getCardData(); @@ -135,9 +135,8 @@ const noticeClick = (num) => { window.open(url, "_blank"); }; -const handleAD = async () => { - console.log(userInfo.value); - if(userInfo.value.status !== 1){ +const handleAD = async () => { + if (userInfo.value.status !== 1) { let res; res = await getMarquee(); if (res.code === 200) { @@ -146,10 +145,13 @@ const handleAD = async () => { res = await getMovie(); if (res.code === 200) { - adData.value = res.data; - popShow.value = true; + // 判斷res.data是否為空Object + if (Object.keys(res.data).length !== 0) { + adData.value = res.data; + popShow.value = true; + } } - } + } }; const popShow = ref(false); @@ -328,7 +330,7 @@ const handleLogout = () => {
- --> + -->
@@ -352,22 +354,20 @@ const handleLogout = () => { @@ -442,7 +442,7 @@ const handleLogout = () => {
- +