This commit is contained in:
@@ -3,12 +3,7 @@
|
||||
<div class="notice" @click.stop>
|
||||
<div class="header">
|
||||
<span class="text">通知</span>
|
||||
<button
|
||||
v-if="hasAuth(NOTIFICATION_PERMISSIONS.readAll)"
|
||||
class="read-all"
|
||||
type="button"
|
||||
@click="handleMarkAllRead"
|
||||
>
|
||||
<button class="read-all" type="button" @click="handleMarkAllRead">
|
||||
全部已读
|
||||
</button>
|
||||
</div>
|
||||
@@ -62,8 +57,6 @@
|
||||
import { NotificationService } from '@/api/modules'
|
||||
import type { NotificationCategory, NotificationItem } from '@/types/api'
|
||||
import { useNotificationStore } from '@/store/modules/notification'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { NOTIFICATION_PERMISSIONS } from '@/config/constants/notification'
|
||||
import { navigateNotificationTarget } from '@/utils/business/notificationNavigation'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
|
||||
@@ -72,7 +65,6 @@
|
||||
|
||||
const router = useRouter()
|
||||
const notificationStore = useNotificationStore()
|
||||
const { hasAuth } = useAuth()
|
||||
const activeCategory = ref<'all' | NotificationCategory>('all')
|
||||
const visible = computed(() => props.modelValue)
|
||||
|
||||
@@ -116,10 +108,6 @@
|
||||
}
|
||||
|
||||
const handleNotificationClick = async (item: NotificationItem) => {
|
||||
if (!hasAuth(NOTIFICATION_PERMISSIONS.read)) {
|
||||
ElMessage.warning('您没有标记通知已读的权限')
|
||||
return
|
||||
}
|
||||
try {
|
||||
const targetResponse = await NotificationService.getTarget(item.id)
|
||||
const readResponse = await notificationStore.markRead(item.id)
|
||||
|
||||
Reference in New Issue
Block a user