feat: stores 部分接入 i18n(auth/settings/apistats/dashboard/clients:标题、错误与日期提示本地化)

This commit is contained in:
Wangnov
2025-09-10 18:04:26 +08:00
parent 5f5826ce56
commit 01eadea10b
5 changed files with 53 additions and 35 deletions

View File

@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import { apiClient } from '@/config/api'
import i18n from '@/i18n'
export const useClientsStore = defineStore('clients', {
state: () => ({
@@ -24,13 +25,13 @@ export const useClientsStore = defineStore('clients', {
if (response.success) {
this.supportedClients = response.data || []
} else {
this.error = response.message || '加载支持的客户端失败'
this.error = response.message || i18n.global.t('common.errors.loadSupportedClientsFailed')
console.error('Failed to load supported clients:', this.error)
}
return this.supportedClients
} catch (error) {
this.error = error.message || '加载支持的客户端失败'
this.error = error.message || i18n.global.t('common.errors.loadSupportedClientsFailed')
console.error('Error loading supported clients:', error)
return []
} finally {