style: auto format

This commit is contained in:
github-actions[bot] 2024-11-06 10:07:57 +00:00
parent e17536621c
commit f894dfe7fd
1 changed files with 13 additions and 10 deletions

View File

@ -30,19 +30,22 @@ async function handler(ctx) {
const { token } = ctx.req.param();
const ua = randUserAgent({ browser: 'chrome', os: 'windows', device: 'desktop' });
const feed = (await cache.tryGet(`toutiao:user:${token}`, async () => {
const query = `category=profile_all&token=${token}&max_behot_time=0&entrance_gid&aid=24&app_name=toutiao_web`;
const feed = (await cache.tryGet(
`toutiao:user:${token}`,
async () => {
const query = `category=profile_all&token=${token}&max_behot_time=0&entrance_gid&aid=24&app_name=toutiao_web`;
const data = await ofetch(`https://www.toutiao.com/api/pc/list/feed?${query}&a_bogus=${generate_a_bogus(query, ua)}`, {
headers: {
'User-Agent': ua,
},
});
const data = await ofetch(`https://www.toutiao.com/api/pc/list/feed?${query}&a_bogus=${generate_a_bogus(query, ua)}`, {
headers: {
'User-Agent': ua,
},
});
return data.data;
},config.cache.routeExpire,
return data.data;
},
config.cache.routeExpire,
false
)) as Feed[];
)) as Feed[];
if (!feed) {
throw new RejectError('无法获取用户信息');