We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a31bafb commit 17225efCopy full SHA for 17225ef
src/layout/components/Message/src/Message.vue
@@ -1,10 +1,12 @@
1
<script lang="ts" setup>
2
import { formatDate } from '@/utils/formatTime'
3
import * as NotifyMessageApi from '@/api/system/notify/message'
4
+import { useUserStoreWithOut } from '@/store/modules/user'
5
6
defineOptions({ name: 'Message' })
7
8
const { push } = useRouter()
9
+const userStore = useUserStoreWithOut()
10
const activeName = ref('notice')
11
const unreadCount = ref(0) // 未读消息数量
12
const list = ref<any[]>([]) // 消息列表
@@ -37,7 +39,11 @@ onMounted(() => {
37
39
// 轮询刷新小红点
38
40
setInterval(
41
() => {
- getUnreadCount()
42
+ if (userStore.getIsSetUser) {
43
+ getUnreadCount()
44
+ } else {
45
+ unreadCount.value = 0
46
+ }
47
},
48
1000 * 60 * 2
49
)
0 commit comments