mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
feat: stores 部分接入 i18n(auth/settings/apistats/dashboard/clients:标题、错误与日期提示本地化)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import router from '@/router'
|
||||
import i18n from '@/i18n'
|
||||
import { apiClient } from '@/config/api'
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
@@ -39,10 +40,10 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
await router.push('/dashboard')
|
||||
} else {
|
||||
loginError.value = result.message || '登录失败'
|
||||
loginError.value = result.message || i18n.global.t('login.loginFailed')
|
||||
}
|
||||
} catch (error) {
|
||||
loginError.value = error.message || '登录失败,请检查用户名和密码'
|
||||
loginError.value = error.message || i18n.global.t('login.loginFailedCheck')
|
||||
} finally {
|
||||
loginLoading.value = false
|
||||
}
|
||||
@@ -102,7 +103,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
// 设置页面标题
|
||||
if (result.data.siteName) {
|
||||
document.title = `${result.data.siteName} - 管理后台`
|
||||
document.title = `${result.data.siteName} - ${i18n.global.t('header.adminPanel')}`
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user