refactor: 前端全面替换 any 为 unknown 并统一错误处理,后端用量记录补写请求头/体

- 前端 API 层、stores、conversation 解析器、组件全面替换 any 为 unknown/具体类型
- 错误处理统一使用 parseApiError/getErrorStatus 替代 err.response?.data?.detail 模式
- 后端 handler/TaskService/UsageLifecycle/StreamTracker 链路传递 request_headers/request_body
- streaming/pending 状态更新时可补写客户端和提供商的请求头及请求体
- 新增 TaskService 和 UsageService 相关测试
This commit is contained in:
fawney19
2026-02-22 00:43:41 +08:00
parent 98e60e8f74
commit cf2eee222e
121 changed files with 1652 additions and 1179 deletions

View File

@@ -773,10 +773,12 @@
{{ formatFullDate(selectedAnnouncement.created_at) }}
</div>
<!-- eslint-disable vue/no-v-html -->
<div
class="prose prose-sm dark:prose-invert max-w-none"
v-html="renderMarkdown(selectedAnnouncement.content)"
/>
<!-- eslint-enable vue/no-v-html -->
</div>
<template #footer>
@@ -998,7 +1000,7 @@ const loadingAnnouncements = ref(false)
const selectedAnnouncement = ref<Announcement | null>(null)
const detailDialogOpen = ref(false)
const iconMap: Record<string, any> = {
const iconMap: Record<string, unknown> = {
Users, Activity, TrendingUp, DollarSign, Key, Hash, Database
}

View File

@@ -291,7 +291,7 @@ async function pollActiveRequests() {
if (shouldApply && record.status !== update.status) {
record.status = update.status
}
if (shouldApply && (update.status === 'completed' || update.status === 'failed')) {
if (shouldApply && ['completed', 'failed', 'cancelled'].includes(update.status)) {
shouldRefresh = true
}