fix(source): zhihu (#92)

fix: k.target.id may exceed the safe integer range (2^53−1), use urlId
This commit is contained in:
olabala
2025-03-27 18:40:14 +08:00
committed by GitHub
parent 41a56e95ef
commit bf88f05d58
+2 -1
View File
@@ -25,13 +25,14 @@ export default defineSource({
const res: Res = await myFetch(url)
return res.data
.map((k) => {
const urlId = k.target.url?.match(/(\d+)$/)?.[1]
return {
id: k.target.id,
title: k.target.title,
extra: {
icon: k.card_label?.night_icon && proxyPicture(k.card_label.night_icon),
},
url: `https://www.zhihu.com/question/${k.target.id}`,
url: `https://www.zhihu.com/question/${urlId || k.target.id}`,
}
})
},