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 @@
本子历史
- +