Commit 02a704cf authored by Junling Bu's avatar Junling Bu
Browse files

perf[litemall-admin]: 微优化通知查询机制

parent 995d2ab5
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.timer = setInterval(this.checkNotice, 10 * 1000) this.timer = setInterval(this.checkNotice, 30 * 1000)
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer) clearInterval(this.timer)
...@@ -30,6 +30,9 @@ export default { ...@@ -30,6 +30,9 @@ export default {
this.$router.push({ path: '/profile/notice' }) this.$router.push({ path: '/profile/notice' })
}, },
checkNotice() { checkNotice() {
if (this.hasNotice) {
return
}
nNotice().then(response => { nNotice().then(response => {
this.hasNotice = response.data.data > 0 this.hasNotice = response.data.data > 0
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment