Skip to content

Commit

Permalink
feat(roure): fix xueqiu relateroute (#17048)
Browse files Browse the repository at this point in the history
* fix xueqiu relate route

* Update lib/routes/xueqiu/cookies.ts

---------

Co-authored-by: cztchoice <cztchoice+wsl@gmail.com>
  • Loading branch information
cztchoice and cztchoice authored Oct 10, 2024
1 parent 6a2cff9 commit 5f20f4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/routes/xueqiu/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ export const parseToken = () =>
if (matches) {
acw_sc__v2 = getAcwScV2ByArg1(matches[1]);
}

const acw_sc__v2_cookie = `acw_sc__v2=${acw_sc__v2}`;
const res = await ofetch.raw('https://xueqiu.com', {
headers: {
Cookie: `acw_sc__v2=${acw_sc__v2}`,
Cookie: acw_sc__v2_cookie,
},
});
const cookieArray = res.headers.getSetCookie();
return cookieArray.find((c) => c.startsWith('xq_a_token='));
const xq_a_token_cookie = cookieArray.find((c) => c.startsWith('xq_a_token='));

return `${acw_sc__v2_cookie}; ${xq_a_token_cookie}`;
},
config.cache.routeExpire,
false
Expand Down

0 comments on commit 5f20f4d

Please sign in to comment.