mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-31 19:08:05 +08:00
24 lines
544 B
TypeScript
24 lines
544 B
TypeScript
|
interface Res {
|
||
|
data: {
|
||
|
hotNews: {
|
||
|
contId: string
|
||
|
name: string
|
||
|
pubTimeLong: string
|
||
|
}[]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default defineSource(async () => {
|
||
|
const url = "https://cache.thepaper.cn/contentapi/wwwIndex/rightSidebar"
|
||
|
const res: Res = await $fetch(url)
|
||
|
return res.data.hotNews
|
||
|
.map((k) => {
|
||
|
return {
|
||
|
id: k.contId,
|
||
|
title: k.name,
|
||
|
url: `https://www.thepaper.cn/newsDetail_forward_${k.contId}`,
|
||
|
mobileUrl: `https://m.thepaper.cn/newsDetail_forward_${k.contId}`,
|
||
|
}
|
||
|
})
|
||
|
})
|