mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-01 11:14:59 +08:00
!573 【修复】修复退出登录后依旧在轮询消息未读数,导致反复弹窗。
Merge pull request !573 from 半栈幼儿员/hotfix/message
This commit is contained in:
commit
8bdf60c886
@ -1,10 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import * as NotifyMessageApi from '@/api/system/notify/message'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
|
||||
defineOptions({ name: 'Message' })
|
||||
|
||||
const { push } = useRouter()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const activeName = ref('notice')
|
||||
const unreadCount = ref(0) // 未读消息数量
|
||||
const list = ref<any[]>([]) // 消息列表
|
||||
@ -37,7 +39,11 @@ onMounted(() => {
|
||||
// 轮询刷新小红点
|
||||
setInterval(
|
||||
() => {
|
||||
getUnreadCount()
|
||||
if (userStore.getIsSetUser) {
|
||||
getUnreadCount()
|
||||
} else {
|
||||
unreadCount.value = 0
|
||||
}
|
||||
},
|
||||
1000 * 60 * 2
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user