fix: add error code

This commit is contained in:
tim
2025-08-05 13:34:28 +08:00
parent dd0beb1955
commit caba1c6658
2 changed files with 6 additions and 4 deletions

View File

@@ -203,12 +203,14 @@ const CommentItem = {
})
showEditor.value = false
toast.success('回复成功')
} else if (res.status === 429) {
toast.error('回复过于频繁,请稍后再试')
} else {
toast.error('回复失败')
toast.error(`回复失败: ${res.status} ${res.statusText}`)
}
} catch (e) {
console.debug('Submit reply error', e)
toast.error('回复失败')
toast.error(`回复失败: ${e.message}`)
} finally {
isWaitingForReply.value = false
}

View File

@@ -397,11 +397,11 @@ export default {
} else if (res.status === 429) {
toast.error('评论过于频繁,请稍后再试')
} else {
toast.error('评论失败')
toast.error(`评论失败: ${res.status} ${res.statusText}`)
}
} catch (e) {
console.debug('Post comment error', e)
toast.error('评论失败')
toast.error(`评论失败: ${e.message}`)
} finally {
isWaitingPostingComment.value = false
}