Skip to content

Commit

Permalink
fix(route): huanqiu (#15107) (#15115)
Browse files Browse the repository at this point in the history
* fix(route): huanqiu (#15107)

* fix(route): huanqiu (fix import)

* Update lib/routes/huanqiu/index.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/routes/huanqiu/index.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/routes/huanqiu/index.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

---------
  • Loading branch information
nashi23 authored Apr 6, 2024
1 parent db6eb1c commit 98e4939
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/routes/huanqiu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,19 @@ async function handler(ctx) {
const resp = await got({
method: 'get',
url: `${host}/api/channel_pc`,
}).json();
const name = getKeysRecursive(resp.children, 'children', 'domain_name', [])[0];
});

const nodes = getKeysRecursive(resp.children, 'children', 'node', [])
const name = getKeysRecursive(resp.data.children, 'children', 'domain_name', [])[0];

const nodes = getKeysRecursive(resp.data.children, 'children', 'node', [])
.map((x) => `"${x}"`)
.join(',');
const req = await got({
method: 'get',
url: `${host}/api/list?node=${nodes}&offset=0&limit=${ctx.req.query('limit') ?? 20}`,
}).json();
});

let items = req.list
let items = req.data.list
.filter((item) => item.aid)
.map((item) => ({
link: `${host}/article/${item.aid}`,
Expand Down

0 comments on commit 98e4939

Please sign in to comment.