fix(frontend): 补齐英文失败路径

This commit is contained in:
2026-09-05 09:48:27 +08:00
parent ef961d322b
commit 89e475c0c2
17 changed files with 83 additions and 70 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import { t } from '@/i18n'
export interface ServiceStatus {
name: string
version: string
@@ -10,7 +12,7 @@ const apiBaseUrl = import.meta.env.VITE_API_BASE_URL ?? ''
export async function getServiceStatus(): Promise<ServiceStatus> {
const response = await fetch(`${apiBaseUrl}/api/status`)
if (!response.ok) {
throw new Error(`后端请求失败:HTTP ${response.status}`)
throw new Error(`${t('后端请求失败:', 'Backend request failed: ')}HTTP ${response.status}`)
}
return response.json() as Promise<ServiceStatus>
}