From 8ce4c1996225c7733e4d3db649c0656844300951 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Wed, 19 Mar 2025 11:06:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E5=8C=96=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=BB=98=E8=AE=A4=E4=B8=BA=E8=8B=B1=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/dayjs.ts | 4 ++-- src/locales/index.ts | 2 +- src/service/request/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locales/dayjs.ts b/src/locales/dayjs.ts index 7dc8f8b..c0145cd 100644 --- a/src/locales/dayjs.ts +++ b/src/locales/dayjs.ts @@ -8,13 +8,13 @@ import { localStg } from '@/utils/storage'; * * @param lang */ -export function setDayjsLocale(lang: App.I18n.LangType = 'zh-CN') { +export function setDayjsLocale(lang: App.I18n.LangType = 'en-US') { const localMap = { 'zh-CN': 'zh-cn', 'en-US': 'en' } satisfies Record; - const l = lang || localStg.get('lang') || 'zh-CN'; + const l = lang || localStg.get('lang') || 'en-US'; locale(localMap[l]); } diff --git a/src/locales/index.ts b/src/locales/index.ts index 40af8a9..b724159 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -4,7 +4,7 @@ import { localStg } from '@/utils/storage'; import messages from './locale'; const i18n = createI18n({ - locale: localStg.get('lang') || 'zh-CN', + locale: localStg.get('lang') || 'en-US', fallbackLocale: 'en', messages, legacy: false diff --git a/src/service/request/index.ts b/src/service/request/index.ts index 230ecf8..a38230f 100644 --- a/src/service/request/index.ts +++ b/src/service/request/index.ts @@ -29,7 +29,7 @@ export const request = createFlatRequest( const Authorization = token ? `Bearer ${token}` : null; // set language - const ContentLanguage = localStg.get('lang') || 'zh-CN'; + const ContentLanguage = localStg.get('lang') || 'en-US'; Object.assign(headers, { Authorization, "Content-Language": ContentLanguage }); return config;