Parcourir la source

fix(frontend): 行Tab页推荐阅读修复 - coverImage补传 + actionArticles过滤修正(indexArticles而非articles)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
asus il y a 1 mois
Parent
commit
f79bccf14a

+ 2 - 1
cfc-frontend/pages/home-pages/parent-index.vue

@@ -1106,7 +1106,8 @@ export default {
               title: item.title || '',
               summary: item.summary || '',
               views: item.viewCount ? String(item.viewCount) : '0',
-              date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
+              date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
+              coverImage: item.coverImage
             }
           })
         }

+ 6 - 5
cfc-frontend/pages/index-home/index.vue

@@ -483,15 +483,15 @@ export default {
       }
     },
     actionArticles: function() {
-      if (!this.articles || this.articles.length === 0) return []
+      if (!this.indexArticles || this.indexArticles.length === 0) return []
       var result = []
-      for (var i = 0; i < this.articles.length; i++) {
-        var a = this.articles[i]
+      for (var i = 0; i < this.indexArticles.length; i++) {
+        var a = this.indexArticles[i]
         if (a.relatedDimensions && a.relatedDimensions.indexOf('action') !== -1) {
           result.push(a)
         }
       }
-      if (result.length === 0) return this.articles.slice(0, 5)
+      if (result.length === 0) return this.indexArticles.slice(0, 5)
       return result.slice(0, 5)
     },
     dimList: function() {
@@ -979,7 +979,8 @@ export default {
               title: item.title || '',
               summary: item.summary || '',
               views: item.viewCount ? String(item.viewCount) : '0',
-              date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
+              date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
+              coverImage: item.coverImage
             }
           })
         }