From 9344d08f1f68997035904181df1199fcd7c7da9f Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 21 十二月 2023 11:35:53 +0800 Subject: [PATCH] 1.完成下载环信码功能 --- src/composables/fetchData.js | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/composables/fetchData.js b/src/composables/fetchData.js index 08c7b46..3598753 100644 --- a/src/composables/fetchData.js +++ b/src/composables/fetchData.js @@ -23,8 +23,22 @@ // 鏁版嵁鑾峰彇 function fetchData() { - fetch(currentPage, pageSize).then((res) => { - - }); + loadStatus.value = 1; + fetch(currentPage.value, pageSize.value) + .then((pageInfo) => { + currentPage.value = pageInfo.currentPage; + totalPage.value = pageInfo.totalPage; + total.value = pageInfo.total; + + loadStatus.value = 0; + }) + .catch(() => { + loadStatus.value = 3; + }) + .finally(() => { + loadStatus.value = 2; + }); } + + return {currentPage, totalPage, pageSize, total, loadStatus, fetchData} } -- Gitblit v1.9.3