mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-21 11:27:27 +08:00
Merge branch 'nagisa77:main' into main
This commit is contained in:
@@ -14,13 +14,15 @@
|
|||||||
<div class="message-control-container">
|
<div class="message-control-container">
|
||||||
<div class="message-control-title">通知设置</div>
|
<div class="message-control-title">通知设置</div>
|
||||||
<div class="message-control-item-container">
|
<div class="message-control-item-container">
|
||||||
<div v-for="pref in notificationPrefs" :key="pref.type" class="message-control-item">
|
<template v-for="pref in notificationPrefs">
|
||||||
<div class="message-control-item-label">{{ formatType(pref.type) }}</div>
|
<div v-if="canShowNotification(pref.type)" :key="pref.type" class="message-control-item">
|
||||||
<BaseSwitch
|
<div class="message-control-item-label">{{ formatType(pref.type) }}</div>
|
||||||
:model-value="pref.enabled"
|
<BaseSwitch
|
||||||
@update:modelValue="(val) => togglePref(pref, val)"
|
:model-value="pref.enabled"
|
||||||
/>
|
@update:modelValue="(val) => togglePref(pref, val)"
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="message-control-container">
|
<div class="message-control-container">
|
||||||
@@ -753,6 +755,14 @@ const formatType = (t) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isAdmin = computed(() => authState.role === 'ADMIN')
|
||||||
|
|
||||||
|
const needAdminSet = new Set(['POST_REVIEW_REQUEST','REGISTER_REQUEST', 'POINT_REDEEM', 'ACTIVITY_REDEEM'])
|
||||||
|
|
||||||
|
const canShowNotification = (type) => {
|
||||||
|
return !needAdminSet.has(type) || isAdmin.value
|
||||||
|
}
|
||||||
|
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
page.value = 0
|
page.value = 0
|
||||||
await fetchNotifications({ page: 0, size: pageSize, unread: selectedTab.value === 'unread' })
|
await fetchNotifications({ page: 0, size: pageSize, unread: selectedTab.value === 'unread' })
|
||||||
|
|||||||
Reference in New Issue
Block a user