lrf402788946 5 anni fa
parent
commit
2475ca39c6
1 ha cambiato i file con 6 aggiunte e 9 eliminazioni
  1. 6 9
      src/views/member.vue

+ 6 - 9
src/views/member.vue

@@ -201,26 +201,23 @@ export default {
     },
     //合并请求模块
     async completeAllModules(modules) {
-      let ids = modules.map(item => item.id);
+      let newMod = modules.filter(fil => fil.category === 'member');
+      let ids = newMod.map(item => item.id);
       let result = await this.getAllColumn(ids);
+
       if (result.length > 0) {
         //整理栏目
         result = result.map(item => {
-          if (item.type === 'column') item.path = `/newsList/module/${item.id}`;
-          else item.path = `/newsList/module/${item.content_id}`;
+          if (item.type === 'column') item.path = `/memberList/module/${item.id}`;
+          else item.path = `/memberList/module/${item.content_id}`;
           return item;
         });
         //请求信息
         let res = await this.getAllNews(result);
-        //合并栏目和信息
+        //合并栏目和信息 这部分少一层,直接将栏目set就可以
         result = result.map(item => {
           let newsList = res.filter(fil => fil.parent_id === item.id);
           item.children = newsList;
-          return item;
-        });
-        modules = modules.map(item => {
-          let children = result.filter(fil => fil.parent_id === item.id);
-          item.children = children;
           this.$set(this, `${item.category}List`, item);
           return item;
         });