fix: tencent news show author avatar (#17301)

This commit is contained in:
huanfei 2024-10-25 19:04:54 +08:00 committed by GitHub
parent 6bfad6c0fb
commit 287b825b4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, Data } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
@ -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}`;
@ -99,5 +100,6 @@ async function handler(ctx) {
description,
link: `https://new.qq.com/omn/author/${mid}`,
item: items,
image: userInfo?.shareImg,
};
}