fix(frontend): 补齐英文失败路径
This commit is contained in:
+3
-1
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user