fix(route): change url in `/tvb/news` (#17098)

This commit is contained in:
After9 2024-10-12 12:02:40 +08:00 committed by GitHub
parent 8b444965ab
commit 830be61360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -85,6 +85,7 @@ async function handler(ctx) {
const language = ctx.req.param('language') ?? 'tc';
const rootUrl = 'https://inews-api.tvb.com';
const linkRootUrl = 'https://news.tvb.com';
const apiUrl = `${rootUrl}/news/entry/category`;
const currentUrl = `${rootUrl}/${language}/${category}`;
@ -102,7 +103,7 @@ async function handler(ctx) {
const items = response.data.content.map((item) => ({
title: item.title,
link: `${rootUrl}/${language}/${category}/${item.id}`,
link: `${linkRootUrl}/${language}/${category}/${item.id}`,
pubDate: parseDate(item.publish_datetime),
category: [...item.category.map((c) => c.title), ...item.tags],
description: art(path.join(__dirname, 'templates/description.art'), {