From 2fcc7a4d32e03afcad0a5fc7648456deba6c2851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Wed, 28 Aug 2024 13:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E7=BB=84=E4=BB=B6=E7=82=B9=E5=87=BB=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/t-position.vue | 2 +- src/plugins/Mys/utils/getPositionCard.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/home/t-position.vue b/src/components/home/t-position.vue index 3d121099..5932a8c1 100644 --- a/src/components/home/t-position.vue +++ b/src/components/home/t-position.vue @@ -7,7 +7,7 @@ diff --git a/src/plugins/Mys/utils/getPositionCard.ts b/src/plugins/Mys/utils/getPositionCard.ts index d6a8f872..99931b5f 100644 --- a/src/plugins/Mys/utils/getPositionCard.ts +++ b/src/plugins/Mys/utils/getPositionCard.ts @@ -4,6 +4,8 @@ * @since Beta v0.5.3 */ +import Mys from "../index.js"; + /** * @description 根据热点追踪信息转为渲染用的数据 * @since Beta v0.5.3 @@ -21,10 +23,14 @@ function getPositionCard( } else { endStr = new Date(Number(position.end_time)).toLocaleDateString().replace(/\//g, "-"); } + let link = position.url; + if (position.url === "" && position.content_id !== 0) { + link = Mys.Api.Obc.replace("{contentId}", position.content_id.toString()); + } const card: TGApp.Plugins.Mys.Position.RenderCard = { title: position.title, - postId: Number(position.url.split("/").pop()), - link: position.url, + postId: position.url !== "" ? Number(position.url.split("/").pop()) : position.content_id, + link: link, icon: position.icon, abstract: position.abstract, time: {