Skip to content

Commit

Permalink
perf[litemall-admin]: 微优化通知查询机制
Browse files Browse the repository at this point in the history
  • Loading branch information
linlinjava committed Feb 13, 2020
1 parent 995d2ab commit 02a704c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion litemall-admin/src/components/Notice/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
}
},
mounted() {
this.timer = setInterval(this.checkNotice, 10 * 1000)
this.timer = setInterval(this.checkNotice, 30 * 1000)
},
beforeDestroy() {
clearInterval(this.timer)
Expand All @@ -30,6 +30,9 @@ export default {
this.$router.push({ path: '/profile/notice' })
},
checkNotice() {
if (this.hasNotice) {
return
}
nNotice().then(response => {
this.hasNotice = response.data.data > 0
})
Expand Down

0 comments on commit 02a704c

Please sign in to comment.