From db0b6319cf8c96e3b0131c43adac5cd99e289267 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Fri, 31 Mar 2023 22:09:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=87=8C=E7=AB=99=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=97=B6=E6=B2=A1=E6=9C=89=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=9A=84=E6=83=85=E5=86=B5=E3=80=82=E9=87=8C=E7=AB=99?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=B6=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=9B=BE=E6=A0=87(=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DashBoard.vue | 40 +++++++++++++++++++++++++++--------- src/components/Side.vue | 5 ++++- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index 9853a88..c3c14df 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -84,7 +84,7 @@
- 查询 + 查询
@@ -228,19 +228,25 @@ function queryGalleries(link){ tempParam = keyword.value } tempParam = tempParam.replace(" ", "+") + document.getElementById("loading").style.display = "inline-block"; axios.get("http://downloader.lionwebsite.xyz/query?keyword=" + tempParam) .then((res) => { - let tempGalleries = JSON.parse(res.data.data) - queryPage.value.first = 'first' in res.data? res.data.first: undefined - queryPage.value.previous = 'previous' in res.data? res.data.previous: undefined - queryPage.value.next = 'next' in res.data? res.data.next: undefined - queryPage.value.last = 'last' in res.data? res.data.last: undefined + document.getElementById("loading").style.display = "none"; + if (res.data.result === "success") { + let tempGalleries = JSON.parse(res.data.data) + queryPage.value.first = 'first' in res.data ? res.data.first : undefined + queryPage.value.previous = 'previous' in res.data ? res.data.previous : undefined + queryPage.value.next = 'next' in res.data ? res.data.next : undefined + queryPage.value.last = 'last' in res.data ? res.data.last : undefined - galleries.value.splice(0) - tempGalleries.forEach((gallery) => { - galleries.value.push(gallery) - }) + galleries.value.splice(0) + tempGalleries.forEach((gallery) => { + galleries.value.push(gallery) + }) + }else { + ElMessage({message: res.data.data, type: "error"}) + } }) } @@ -305,4 +311,18 @@ onMounted(() => { .el-input{ width: 300px; } + + #loading { + width: 25px; + height: 25px; + border: 2px solid #ccc; + border-top-color: #3498db; + border-radius: 50%; + animation: spin 1s linear infinite; + display: none; + } + + @keyframes spin { + to { transform: rotate(360deg); } + } \ No newline at end of file diff --git a/src/components/Side.vue b/src/components/Side.vue index c7e210d..a86a3b1 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -2,7 +2,10 @@
本子历史
- +