From cceeed99687b22613978e83276a91dd7ab071d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Tue, 3 Sep 2024 22:01:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E7=89=B9?= =?UTF-8?q?=E5=AE=9A=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/common/PostCollect.vue | 6 +++++- src/plugins/Sqlite/modules/userCollect.ts | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/common/PostCollect.vue b/src/pages/common/PostCollect.vue index 00eb202a..080379d7 100644 --- a/src/pages/common/PostCollect.vue +++ b/src/pages/common/PostCollect.vue @@ -439,7 +439,11 @@ function getPageItems(): TGApp.Plugins.Mys.Post.FullData[] { card.push(JSON.parse(post.content)); } catch (e) { TGLogger.Error("[PostCollect] getPageItems"); - TGLogger.Error(e); + if (typeof e === "string") { + TGLogger.Error(e); + } else if (e instanceof Error) { + TGLogger.Error(e.message); + } } } return card; diff --git a/src/plugins/Sqlite/modules/userCollect.ts b/src/plugins/Sqlite/modules/userCollect.ts index 5d069180..d6a38892 100644 --- a/src/plugins/Sqlite/modules/userCollect.ts +++ b/src/plugins/Sqlite/modules/userCollect.ts @@ -1,7 +1,7 @@ /** * @file plugins/Sqlite/modules/userCollect.ts * @description 用户收藏模块 - * @since Beta v0.5.1 + * @since Beta v0.5.5 */ import TGSqlite from "../index.js"; @@ -41,7 +41,7 @@ async function getCollectList(): Promise} 返回收藏合集中的帖子列表 */ @@ -55,7 +55,7 @@ async function getCollectPostList( for (let i = 0; i < res.length; i++) { const postSql = "SELECT * FROM UFPost WHERE id = ?"; const postRes: TGApp.Sqlite.UserCollection.UFPost[] = await db.select(postSql, [res[i].postId]); - postList.push(postRes[0]); + if (postRes.length > 0) postList.push(postRes[0]); } return postList; }