接口数据统一

This commit is contained in:
imsyy 2023-03-17 11:52:40 +08:00
parent bf39b928e1
commit f18f9d7cf9
4 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@ const getData = (data) => {
title: v.query, title: v.query,
desc: v.desc, desc: v.desc,
pic: v.img, pic: v.img,
hot: v.hotScore, hot: Number(v.hotScore),
url: `https://www.baidu.com/s?wd=${encodeURIComponent(v.query)}`, url: `https://www.baidu.com/s?wd=${encodeURIComponent(v.query)}`,
mobileUrl: v.url, mobileUrl: v.url,
}); });

View File

@ -23,6 +23,7 @@ const getData = (data) => {
pic: v.pic.replace(/http:/, "https:"), pic: v.pic.replace(/http:/, "https:"),
owner: v.owner, owner: v.owner,
data: v.stat, data: v.stat,
hot: v.stat.view,
url: v.short_link, url: v.short_link,
mobileUrl: `https://m.bilibili.com/video/${v.bvid}`, mobileUrl: `https://m.bilibili.com/video/${v.bvid}`,
}; };

View File

@ -20,6 +20,7 @@ const getData = (data) => {
id: v.contId, id: v.contId,
title: v.name, title: v.name,
pic: v.pic, pic: v.pic,
hot: v.praiseTimes,
time: v.pubTime, time: v.pubTime,
url: `https://www.thepaper.cn/newsDetail_forward_${v.contId}`, url: `https://www.thepaper.cn/newsDetail_forward_${v.contId}`,
mobileUrl: `https://m.thepaper.cn/newsDetail_forward_${v.contId}`, mobileUrl: `https://m.thepaper.cn/newsDetail_forward_${v.contId}`,

View File

@ -30,7 +30,7 @@ const getData = (data) => {
title: v.target.titleArea.text, title: v.target.titleArea.text,
desc: v.target.excerptArea.text, desc: v.target.excerptArea.text,
pic: v.target.imageArea.url, pic: v.target.imageArea.url,
hot: v.target.metricsArea.text, hot: parseInt(v.target.metricsArea.text.replace(/[^\d]/g, "")) * 10000,
url: v.target.link.url, url: v.target.link.url,
mobileUrl: v.target.link.url, mobileUrl: v.target.link.url,
}); });