From e78f724af7e7971ae53f56b7d20e8018015f5b24 Mon Sep 17 00:00:00 2001 From: Ou Date: Thu, 21 Nov 2024 23:42:23 +0800 Subject: [PATCH] fix(source): xueqqiu fetch error --- server/sources/xueqiu.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sources/xueqiu.ts b/server/sources/xueqiu.ts index 749ceaf..274fa18 100644 --- a/server/sources/xueqiu.ts +++ b/server/sources/xueqiu.ts @@ -15,12 +15,13 @@ interface StockRes { const hotstock = defineSource(async () => { const url = "https://stock.xueqiu.com/v5/stock/hot_stock/list.json?size=30&_type=10&type=10" - const cookie = (await $fetch.raw("https://xueqiu.com")).headers.getSetCookie() + const cookie = (await $fetch.raw("https://xueqiu.com/hq")).headers.getSetCookie() const res: StockRes = await myFetch(url, { headers: { cookie: cookie.join("; "), }, }) + console.log(res) return res.data.items.filter(k => !k.ad).map(k => ({ id: k.code, url: `https://xueqiu.com/s/${k.code}`,