2024-10-30 15:59:59 +08:00

27 lines
510 B
TypeScript

interface Res {
data: {
bang_topic: {
topic_list: {
topic_id: string
topic_name: string
create_time: number
topic_url: string
}[]
}
}
}
export default defineSource(async () => {
const url = "https://tieba.baidu.com/hottopic/browse/topicList"
const res: Res = await myFetch(url)
return res.data.bang_topic.topic_list
.map((k) => {
return {
id: k.topic_id,
title: k.topic_name,
url: k.topic_url,
}
})
})