yangys
2025-09-01 834838fa09fb2f84760a234ed7677648e8a0b458
src/page/index/top/top-menu.vue
@@ -61,16 +61,22 @@
      items: [],
      logsLen: 0,//任务提醒数量
      intervalId : undefined
    };
  },
  inject: ['index'],
  created() {
    this.getMenu();
    this.getCount()
    setInterval(() => {
    this.getCount();
    window.remindIntervalId = setInterval(() => {
      this.getCount();
    }, 2*60*1000);
    }, 2*60*1000)//
    window.myemitter.on('todochange', (data)=>{
      this.getCount();
    });
  },
  
  computed: {
@@ -94,10 +100,17 @@
        //this.box = false;
    },
    getCount() {
      getList(1,10).then((res) => {
        this.logsLen = res.data.data.total;
        this.dataList = res.data.data.records;
      });
      try{
        getList(1,10).then((res) => {
          this.logsLen = res.data.data.total;
          this.dataList = res.data.data.records;
        }).catch(e=>{
          console.log('3333',this.intervalId)
          clearInterval(this.intervalId);
        });
      }catch(e2){
        console.log('e2',e2);
      }
    }
  },
};