!573 【修复】修复退出登录后依旧在轮询消息未读数,导致反复弹窗。

Merge pull request !573 from 半栈幼儿员/hotfix/message
pull/568/MERGE
芋道源码 2024-10-27 08:36:40 +00:00 committed by Gitee
commit 8bdf60c886
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 1 deletions

View File

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