🐞 fix:修复退出登录后依旧在轮询消息未读数,导致反复弹窗。

This commit is contained in:
preschooler 2024-10-25 10:11:42 +08:00
parent a31bafbb4a
commit 17225ef3df

@ -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
)