sc
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user