lrf402788946 5 роки тому
батько
коміт
bae474cae2
2 змінених файлів з 10 додано та 3 видалено
  1. 8 3
      src/views/index/index.vue
  2. 2 0
      src/views/master/news/detail.vue

+ 8 - 3
src/views/index/index.vue

@@ -283,7 +283,8 @@ export default {
         let allMenu = result.data;
         for (let item of allMenu) {
           if (item.type === 'content') {
-            item.path = `/info/detail?id=${item.content_id}`;
+            if (this.user === 'master') item.path = `/master/news/${item.content_id}`;
+            else item.path = `/info/detail?id=${item.content_id}`;
           } else if (item.type !== 'url') {
             let res = await this.completeMenu(item);
             item.children = res;
@@ -299,8 +300,12 @@ export default {
       if (`${res.errcode}` === '0') {
         //组合path:res.data内容都为栏目.所以,点击这些栏目显示的列表应该是信息列表,需要用栏目的id作为查询信息的parten_id查出不同栏目的信息
         for (const col of res.data) {
-          if (col.type === 'content') col.path = `/info/detail?id=${col.content_id}`;
-          else if (col.type !== 'url') col.path = `/info/list/${col.id}`;
+          if (col.type === 'content') {
+            if(this.user === 'master') {
+              col.path = `/master/`
+            }
+            col.path = `/info/detail?id=${col.content_id}`;
+          } else if (col.type !== 'url') col.path = `/info/list/${col.id}`;
         }
         return res.data;
       }

+ 2 - 0
src/views/master/news/detail.vue

@@ -120,6 +120,8 @@ export default {
     async search() {
       if (this.type === 'jobinfo') this.getJobInfo();
       if (this.type === 'talk') this.getTalk();
+      if (this.type === 'jobfair') this.getJobfair();
+      if (this.type === 'news') this.getInfo();
     },
     //jobinfo部分
     async getJobInfo() {