fix(frontend): 收敛重复错误弹窗并统一去重处理

This commit is contained in:
root
2026-03-08 15:10:09 +08:00
parent 1a00afd628
commit af9bc8f21e
8 changed files with 51 additions and 19 deletions

View File

@@ -7,6 +7,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import { getSingerById, isSingerCollected, collectSinger, uncollectSinger } from '../api/singer'
import { getCommentList, addComment, deleteComment as apiDeleteComment } from '../api/comment'
import { processImageUrl } from '../utils/imageUtils'
import { showErrorOnce } from '../utils/errorHandler'
import { processMusicUrl, getMusicBySinger, getMusicStatus } from '../api/music'
import { connect, subscribe, unsubscribe, disconnect } from '../utils/websocket' // 导入 WebSocket 工具
import MusicList from '../components/MusicList.vue'
@@ -219,7 +220,7 @@ const toggleCollect = async () => {
}
} catch (error) {
console.error('收藏操作失败:', error)
ElMessage.error('操作失败,请稍后重试')
showErrorOnce(error, '操作失败,请稍后重试')
}
}
@@ -311,7 +312,7 @@ const submitComment = async (isReply = false) => {
}
} catch (error) {
console.error('提交评论失败:', error)
ElMessage.error('评论失败,请稍后重试')
showErrorOnce(error, '评论失败,请稍后重试')
}
}
@@ -336,7 +337,7 @@ const deleteComment = async (commentId) => {
} catch (error) {
if (error !== 'cancel') {
console.error('删除评论失败:', error)
ElMessage.error('删除失败,请稍后重试')
showErrorOnce(error, '删除失败,请稍后重试')
}
}
}