Parcourir la source

fix: 维度首页推荐阅读补传 dimensionCode,与知识中心一致

body/index.vue 和 wealth/index.vue 的 loadFeaturedArticles 未传
dimensionCode 参数,导致后端返回所有精选文章而非按维度过滤。

- body/index.vue: 补传 dimensionCode: 'body'
- wealth/index.vue: 补传 dimensionCode: 'wealth',移除客户端
  relatedDimensions hack(后端已正确过滤无需前端二次筛选)
Xiaogang Liao il y a 1 mois
Parent
commit
b3e0270be8
2 fichiers modifiés avec 3 ajouts et 10 suppressions
  1. 1 1
      cfc-frontend/pages/body/index.vue
  2. 2 9
      cfc-frontend/pages/wealth/index.vue

+ 1 - 1
cfc-frontend/pages/body/index.vue

@@ -377,7 +377,7 @@ export default {
     },
     loadFeaturedArticles: function() {
       var self = this
-      getFeaturedArticles({ size: 5 }).then(function(res) {
+      getFeaturedArticles({ size: 5, dimensionCode: 'body' }).then(function(res) {
         if (res.code === 200 && res.data) {
           var gradientColors = [
             'linear-gradient(135deg, #FF8C42, #FFB074)',

+ 2 - 9
cfc-frontend/pages/wealth/index.vue

@@ -347,17 +347,10 @@ export default {
     loadWealthArticles: function() {
       var self = this
       self.articlesLoading = true
-      getFeaturedArticles({ size: 5 }).then(function(res) {
+      getFeaturedArticles({ size: 5, dimensionCode: 'wealth' }).then(function(res) {
         if (res.code === 200 && res.data) {
           var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
-          var result = []
-          for (var i = 0; i < list.length; i++) {
-            var a = list[i]
-            if (a.relatedDimensions && a.relatedDimensions.indexOf('wealth') !== -1) {
-              result.push(a)
-            }
-          }
-          self.wealthArticles = result.length > 0 ? result.slice(0, 5) : list.slice(0, 5)
+          self.wealthArticles = list.slice(0, 5)
         }
       }).catch(function() {
         self.wealthArticles = []