fix: 去掉通知的权限
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m51s

This commit is contained in:
luo
2026-07-28 16:08:34 +08:00
parent 261f5f2853
commit b51a3f5537
6 changed files with 50 additions and 43 deletions

View File

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