diff --git a/src/api/newsInfo.ts b/src/api/newsInfo.ts index 8d873d8..662973e 100644 --- a/src/api/newsInfo.ts +++ b/src/api/newsInfo.ts @@ -17,8 +17,8 @@ export const getConceptCount = (data: any) => { // 概念标签贴标 export const getTopNews = (data: any) => { - // return request.get("/top_news_h5_d", data); - return request.get("/top_news_release_h5_all", data); + return request.get("/top_news_h5_d", data); + // return request.get("/top_news_release_h5_all", data); }; // 概念标签贴标 export const getTopNewsAll = (data: any) => { diff --git a/src/components/RankList.vue b/src/components/RankList.vue index f0a8576..f6e3a90 100644 --- a/src/components/RankList.vue +++ b/src/components/RankList.vue @@ -88,14 +88,20 @@ watch( (newValue, oldValue) => { rankListLocal.value = []; props.newsList.forEach((item, index) => { + console.log("🚀 ~ item:", item); if (!isExp.value && index > 9) { return; } - + let concept_label = ""; + let industry_label = ""; + try { + concept_label = JSON.parse(item.concept_label); + industry_label = JSON.parse(item.industry_label); + } catch (e) {} rankListLocal.value.push({ ...item, - conceptLabels: JSON.parse(item.concept_label), - industryLabels: JSON.parse(item.industry_label), + conceptLabels: concept_label, + industryLabels: industry_label, }); }); @@ -114,11 +120,17 @@ watch( if (!isExp.value && index > 9) { return; } + let concept_label = ""; + let industry_label = ""; + try { + concept_label = JSON.parse(item.concept_label); + industry_label = JSON.parse(item.industry_label); + } catch (e) {} rankListLocal.value.push({ ...item, - conceptLabels: JSON.parse(item.concept_label), - industryLabels: JSON.parse(item.industry_label), + conceptLabels: concept_label, + industryLabels: industry_label, }); }); loading.value = false;