mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
d7c8a38d88
fixed #20
27 lines
510 B
TypeScript
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,
|
|
}
|
|
})
|
|
})
|