feat: 注意事项
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m43s

This commit is contained in:
luo
2026-07-25 14:37:27 +08:00
parent dd6bceeeb7
commit cc6fc9243e
5 changed files with 13 additions and 49 deletions

View File

@@ -184,6 +184,7 @@
</template>
<script setup lang="ts">
import { onBeforeUnmount, onMounted } from 'vue'
import { MenuTypeEnum, MenuWidth } from '@/enums/appEnum'
import { useSettingStore } from '@/store/modules/setting'
import { useUserStore } from '@/store/modules/user'
@@ -264,9 +265,18 @@
initLanguage()
if (hasAuth(NOTIFICATION_PERMISSIONS.page)) {
void notificationStore.refreshUnreadCount().catch(() => undefined)
unreadTimer = window.setInterval(() => {
void notificationStore.refreshUnreadCount().catch(() => undefined)
}, 30_000)
}
})
let unreadTimer: number | undefined
onBeforeUnmount(() => {
if (unreadTimer !== undefined) window.clearInterval(unreadTimer)
})
const { isFullscreen, toggle: toggleFullscreen } = useFullscreen()
const toggleFullScreen = () => {

View File

@@ -128,12 +128,12 @@
return
}
try {
const targetResponse = await NotificationService.getTarget(item.id)
const readResponse = await notificationStore.markRead(item.id)
if (readResponse.code !== 0) {
ElMessage.error(readResponse.msg || '标记已读失败')
return
}
const targetResponse = await NotificationService.getTarget(item.id)
if (targetResponse.code !== 0 || !targetResponse.data) {
ElMessage.info(item.body || '该通知暂无可跳转目标')
return