Skip to content

Commit

Permalink
fix: tencent news show author avatar (#17301)
Browse files Browse the repository at this point in the history
  • Loading branch information
huanfe1 authored Oct 25, 2024
1 parent 6bfad6c commit 287b825
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/routes/tencent/news/author.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, Data } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

Expand All @@ -25,15 +25,16 @@ export const route: Route = {
},
radar: [
{
source: ['new.qq.com/omn/author/:mid'],
title: '当前作者文章',
source: ['news.qq.com/omn/author/:mid'],
},
],
name: '更新',
name: '作者',
maintainers: ['LogicJake', 'miles170'],
handler,
};

async function handler(ctx) {
async function handler(ctx): Promise<Data> {
const mid = ctx.req.param('mid');
const userType = /^\d+$/.test(mid) ? 'chlid' : 'guestSuid';
const homePageInfoUrl = `https://i.news.qq.com/i/getUserHomepageInfo?${userType}=${mid}`;
Expand Down Expand Up @@ -99,5 +100,6 @@ async function handler(ctx) {
description,
link: `https://new.qq.com/omn/author/${mid}`,
item: items,
image: userInfo?.shareImg,
};
}

0 comments on commit 287b825

Please sign in to comment.