|
@@ -37,16 +37,22 @@ let getAll = function (callback) {
|
|
|
let result = res.data.results
|
|
|
// 循环遍历结果数组,可以在请求拿到结果时进行,然后追加,此处可判断是否等于全局日期变量
|
|
|
result.forEach((v, i) => {
|
|
|
+ console.log(v)
|
|
|
// 处理返回的标签列表,即概念题材
|
|
|
let tags = []
|
|
|
+ let tagIndex = []
|
|
|
if (v.plateids) {
|
|
|
v.plateids = v.plateids.split(';')
|
|
|
v.plateids.forEach((v, i) => {
|
|
|
- v = v.substring(9)
|
|
|
- console.log(v)
|
|
|
- tags = tags.concat(v)
|
|
|
+ let tagSplit = v.split(',')
|
|
|
+ console.log(tagSplit)
|
|
|
+ if (tags.length < 2) {
|
|
|
+ tags = tags.concat(tagSplit[1])
|
|
|
+ tagIndex = tagIndex.concat(tagSplit[0])
|
|
|
+ }
|
|
|
})
|
|
|
v.tags = tags
|
|
|
+ v.tagIndex = tagIndex
|
|
|
}
|
|
|
// 处理返回的大时间
|
|
|
const newDate = v.showtime.substring(0, 10)
|
|
@@ -93,14 +99,19 @@ let getBigNews = function (callback) {
|
|
|
result.forEach((v, i) => {
|
|
|
// 处理返回的标签列表,即概念题材
|
|
|
let tags = []
|
|
|
+ let tagIndex = []
|
|
|
if (v.plateids) {
|
|
|
v.plateids = v.plateids.split(';')
|
|
|
v.plateids.forEach((v, i) => {
|
|
|
- v = v.substring(9)
|
|
|
- console.log(v)
|
|
|
- tags = tags.concat(v)
|
|
|
+ let tagSplit = v.split(',')
|
|
|
+ console.log(tagSplit)
|
|
|
+ if (tags.length < 2) {
|
|
|
+ tags = tags.concat(tagSplit[1])
|
|
|
+ tagIndex = tagIndex.concat(tagSplit[0])
|
|
|
+ }
|
|
|
})
|
|
|
v.tags = tags
|
|
|
+ v.tagIndex = tagIndex
|
|
|
}
|
|
|
const newDate = v.showtime.substring(0, 10)
|
|
|
if (newDate !== bigDate) {
|
|
@@ -146,14 +157,19 @@ let getChanges = function (callback) {
|
|
|
result.forEach((v, i) => {
|
|
|
// 处理返回的标签列表,即概念题材
|
|
|
let tags = []
|
|
|
+ let tagIndex = []
|
|
|
if (v.plateids) {
|
|
|
v.plateids = v.plateids.split(';')
|
|
|
v.plateids.forEach((v, i) => {
|
|
|
- v = v.substring(9)
|
|
|
- console.log(v)
|
|
|
- tags = tags.concat(v)
|
|
|
+ let tagSplit = v.split(',')
|
|
|
+ console.log(tagSplit)
|
|
|
+ if (tags.length < 2) {
|
|
|
+ tags = tags.concat(tagSplit[1])
|
|
|
+ tagIndex = tagIndex.concat(tagSplit[0])
|
|
|
+ }
|
|
|
})
|
|
|
v.tags = tags
|
|
|
+ v.tagIndex = tagIndex
|
|
|
}
|
|
|
const newDate = v.showtime.substring(0, 10)
|
|
|
if (newDate !== changeDate) {
|
|
@@ -199,14 +215,19 @@ let getGoodNews = function (callback) {
|
|
|
result.forEach((v, i) => {
|
|
|
// 处理返回的标签列表,即概念题材
|
|
|
let tags = []
|
|
|
+ let tagIndex = []
|
|
|
if (v.plateids) {
|
|
|
v.plateids = v.plateids.split(';')
|
|
|
v.plateids.forEach((v, i) => {
|
|
|
- v = v.substring(9)
|
|
|
- console.log(v)
|
|
|
- tags = tags.concat(v)
|
|
|
+ let tagSplit = v.split(',')
|
|
|
+ console.log(tagSplit)
|
|
|
+ if (tags.length < 2) {
|
|
|
+ tags = tags.concat(tagSplit[1])
|
|
|
+ tagIndex = tagIndex.concat(tagSplit[0])
|
|
|
+ }
|
|
|
})
|
|
|
v.tags = tags
|
|
|
+ v.tagIndex = tagIndex
|
|
|
}
|
|
|
const newDate = v.showtime.substring(0, 10)
|
|
|
if (newDate !== goodDate) {
|
|
@@ -253,14 +274,19 @@ let getNotice = function (callback) {
|
|
|
result.forEach((v, i) => {
|
|
|
// 处理返回的标签列表,即概念题材
|
|
|
let tags = []
|
|
|
+ let tagIndex = []
|
|
|
if (v.plateids) {
|
|
|
v.plateids = v.plateids.split(';')
|
|
|
v.plateids.forEach((v, i) => {
|
|
|
- v = v.substring(9)
|
|
|
- console.log(v)
|
|
|
- tags = tags.concat(v)
|
|
|
+ let tagSplit = v.split(',')
|
|
|
+ console.log(tagSplit)
|
|
|
+ if (tags.length < 2) {
|
|
|
+ tags = tags.concat(tagSplit[1])
|
|
|
+ tagIndex = tagIndex.concat(tagSplit[0])
|
|
|
+ }
|
|
|
})
|
|
|
v.tags = tags
|
|
|
+ v.tagIndex = tagIndex
|
|
|
}
|
|
|
const newDate = v.showtime.substring(0, 10)
|
|
|
if (newDate !== noticeDate) {
|
|
@@ -335,4 +361,4 @@ module.exports = {
|
|
|
getImportantNews: getImportantNews,
|
|
|
getNoPlatelist: getNoPlatelist,
|
|
|
getNotice: getNotice
|
|
|
-}
|
|
|
+}
|