This commit is contained in:
qsh
2024-09-06 18:09:25 +08:00
parent ecc89f47bb
commit 3678c5fcc4
2 changed files with 14 additions and 15 deletions

View File

@@ -17,7 +17,7 @@
</template>
<script setup name="NMDetail">
import { getNotifyMessageDetail } from '@/api/system/notify/message'
import { getNotifyMessageDetail, updateNotifyMessageRead } from '@/api/system/notify/message'
import { formatDate } from '@/utils/formatTime'
const route = useRoute()
@@ -26,9 +26,21 @@ const info = ref({})
function init() {
getNotifyMessageDetail(route.query.id).then((data) => {
info.value = data
if (!data.readStatus) {
handleReadOne(data.id)
}
})
}
/** 标记一条站内信已读 */
const handleReadOne = async (id) => {
await updateNotifyMessageRead({
ids: [id]
// roleId: userStore.getUser?.currentRole
})
await getList()
}
onMounted(() => {
init()
})