let timer = null;
            setInterval(() => {
                let date = new Date();
                let hours = date.getHours();
                if (hours < 1 || hours > 7) { // 1-8点不更新
                    if(timer == null){
                        timer = setInterval(()=>{
                            this.$store.dispatch('GetUnreadMessageCount') // 每隔10分钟更新TOKEN
                        }, 10 * 60 * 1000)
                    }
                } else {
                    clearInterval(timer);
                    timer = null;
                }
            }, 15 * 60 * 1000)

  

相关文章:

  • 2022-01-27
  • 2021-05-15
  • 2021-10-14
  • 2021-05-28
  • 2021-10-13
  • 2022-12-23
  • 2021-12-25
  • 2021-05-01
猜你喜欢
  • 2021-09-26
  • 2021-11-19
  • 2022-01-01
  • 2021-07-20
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
相关资源
相似解决方案