refactor: replace useBackgroundOptimization with unified useBackground composable and update Nginx SSE route configuration

This commit is contained in:
jxxghp
2026-05-17 08:32:17 +08:00
parent bbe3368c69
commit 75862c026a
20 changed files with 328 additions and 147 deletions

View File

@@ -3,11 +3,11 @@ import type { Message } from '@/api/types'
import MessageCard from '@/components/cards/MessageCard.vue'
import api from '@/api'
import { useI18n } from 'vue-i18n'
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
import { useBackground } from '@/composables/useBackground'
// 国际化
const { t } = useI18n()
const { useSSE } = useBackgroundOptimization()
const { useSSE } = useBackground()
// 消息列表
const messages = ref<Message[]>([])
@@ -201,7 +201,7 @@ function handleSSEMessage(event: MessageEvent) {
}
}
// 使用优化的SSE连接
// 使用SSE连接
const { manager, isConnected } = useSSE(
`${import.meta.env.VITE_API_BASE_URL}system/message?role=user`,
handleSSEMessage,