From 048522e46bc0574c556660f53c08611e836ced48 Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Thu, 7 Sep 2023 23:41:10 +0800 Subject: [PATCH] fix empty data error --- src/pages/chase/binge/Binge.vue | 4 ++-- src/pages/chase/history/History.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/chase/binge/Binge.vue b/src/pages/chase/binge/Binge.vue index a50b0b046..14e0fbf2c 100644 --- a/src/pages/chase/binge/Binge.vue +++ b/src/pages/chase/binge/Binge.vue @@ -89,8 +89,8 @@ const getBingeList = async () => { const res = await star.pagination(pagination.value.pageIndex, pagination.value.pageSize); res.list.map(async (item) => { const { siteKey } = item; - const { name } = await sites.find({ key: siteKey }); - item.siteName = name; + const res = await sites.find({ key: siteKey }); + item.siteName = _.has(res, "name") ? res.name : '该源应该被删除了哦'; }); bingeList.value = _.unionWith(bingeList.value, res.list, _.isEqual); pagination.value.count = res.total; diff --git a/src/pages/chase/history/History.vue b/src/pages/chase/history/History.vue index 0aa413637..55dc4796c 100644 --- a/src/pages/chase/history/History.vue +++ b/src/pages/chase/history/History.vue @@ -99,8 +99,8 @@ const getHistoryList = async () => { res.list.forEach(async (item) => { const { date, siteKey } = item; - const { name } = await sites.find({ key: siteKey }); - item.siteName = name; + const res = await sites.find({ key: siteKey }); + item.siteName = _.has(res, "name") ? res.name : '该源应该被删除了哦'; console.log(item); const timeDiff = filterDate(date); let timeKey;