fix: Tencent news can't fetch non-digital users (#16798)
* fix: Unable to fetch non-digital users * fix: add type variable * fix: add semicolons
This commit is contained in:
@@ -35,7 +35,8 @@ export const route: Route = {
|
||||
|
||||
async function handler(ctx) {
|
||||
const mid = ctx.req.param('mid');
|
||||
const homePageInfoUrl = `https://i.news.qq.com/i/getUserHomepageInfo?chlid=${mid}`;
|
||||
const userType = /^\d+$/.test(mid) ? "chlid" : "guestSuid";
|
||||
const homePageInfoUrl = `https://i.news.qq.com/i/getUserHomepageInfo?${userType}=${mid}`;
|
||||
const userInfo = await cache.tryGet(homePageInfoUrl, async () => (await got(homePageInfoUrl)).data.userinfo);
|
||||
const title = userInfo.nick;
|
||||
const description = userInfo.user_desc;
|
||||
|
||||
Reference in New Issue
Block a user