14th_check
This commit is contained in:
@@ -246,7 +246,13 @@ const handleMenuClick = () => {
|
||||
const showNotifications = async () => {
|
||||
notificationDrawerVisible.value = true
|
||||
// 載入最新通知
|
||||
await notificationStore.fetchNotifications()
|
||||
console.log('🔔 正在載入通知...')
|
||||
try {
|
||||
await notificationStore.fetchNotifications()
|
||||
console.log('🔔 通知載入完成:', notificationStore.notifications.length)
|
||||
} catch (error) {
|
||||
console.error('🔔 通知載入失敗:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleUserMenuCommand = async (command) => {
|
||||
@@ -331,7 +337,12 @@ onMounted(() => {
|
||||
// initWebSocket()
|
||||
|
||||
// 載入通知
|
||||
notificationStore.fetchNotifications()
|
||||
console.log('🔔 初始化載入通知...')
|
||||
notificationStore.fetchNotifications().then(() => {
|
||||
console.log('🔔 初始化通知載入完成:', notificationStore.notifications.length)
|
||||
}).catch(error => {
|
||||
console.error('🔔 初始化通知載入失敗:', error)
|
||||
})
|
||||
|
||||
// 監聽窗口大小變化
|
||||
window.addEventListener('resize', handleResize)
|
||||
|
@@ -29,14 +29,14 @@ export const notificationAPI = {
|
||||
* @param {string} notificationId - 通知ID
|
||||
*/
|
||||
markAsRead(notificationId) {
|
||||
return request.put(`/notifications/${notificationId}/read`)
|
||||
return request.post(`/notifications/${notificationId}/read`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 標記所有通知為已讀
|
||||
*/
|
||||
markAllAsRead() {
|
||||
return request.put('/notifications/mark-all-read')
|
||||
return request.post('/notifications/read-all')
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user