Skip to content

Commit 02a704c

Browse files
committed
perf[litemall-admin]: 微优化通知查询机制
1 parent 995d2ab commit 02a704c

File tree

1 file changed

+4
-1
lines changed
  • litemall-admin/src/components/Notice

1 file changed

+4
-1
lines changed

litemall-admin/src/components/Notice/index.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
}
1818
},
1919
mounted() {
20-
this.timer = setInterval(this.checkNotice, 10 * 1000)
20+
this.timer = setInterval(this.checkNotice, 30 * 1000)
2121
},
2222
beforeDestroy() {
2323
clearInterval(this.timer)
@@ -30,6 +30,9 @@ export default {
3030
this.$router.push({ path: '/profile/notice' })
3131
},
3232
checkNotice() {
33+
if (this.hasNotice) {
34+
return
35+
}
3336
nNotice().then(response => {
3437
this.hasNotice = response.data.data > 0
3538
})

0 commit comments

Comments
 (0)