mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
fix(source): wallstreetcn-news
This commit is contained in:
parent
198133f25d
commit
00b089ff53
@ -2,8 +2,6 @@ interface Item {
|
|||||||
uri: string
|
uri: string
|
||||||
id: number
|
id: number
|
||||||
title?: string
|
title?: string
|
||||||
// ad
|
|
||||||
resource_type?: string
|
|
||||||
content_text: string
|
content_text: string
|
||||||
content_short: string
|
content_short: string
|
||||||
display_time: number
|
display_time: number
|
||||||
@ -18,6 +16,8 @@ interface LiveRes {
|
|||||||
interface NewsRes {
|
interface NewsRes {
|
||||||
data: {
|
data: {
|
||||||
items: {
|
items: {
|
||||||
|
// ad
|
||||||
|
resource_type?: string
|
||||||
resource: Item
|
resource: Item
|
||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ const news = defineSource(async () => {
|
|||||||
|
|
||||||
const res: NewsRes = await $fetch(apiUrl)
|
const res: NewsRes = await $fetch(apiUrl)
|
||||||
return res.data.items
|
return res.data.items
|
||||||
.filter(k => k.resource.resource_type !== "ad" && k.resource.type !== "live")
|
.filter(k => k.resource_type !== "ad" && k.resource.type !== "live" && k.resource.uri)
|
||||||
.map(({ resource: h }) => {
|
.map(({ resource: h }) => {
|
||||||
return {
|
return {
|
||||||
id: h.id,
|
id: h.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user