diff --git a/src/i18n/index.ts b/src/i18n/index.ts index aa344943..3e76e545 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -6,7 +6,7 @@ import enUS from './locales/en-US'; const i18n = createI18n({ legacy: false, // 使用 Composition API 的方式创建 i18n 实例 - locale: localGet(CACHE_LOCAL_I18N) || 'zh_CN', // 默认显示语言 + locale: localGet(CACHE_LOCAL_I18N) || 'en-US', // 默认显示语言 messages: { zh_CN: zhCN, en_US: enUS, diff --git a/src/plugins/http-fetch.ts b/src/plugins/http-fetch.ts index 9a66419c..1eee7479 100644 --- a/src/plugins/http-fetch.ts +++ b/src/plugins/http-fetch.ts @@ -4,8 +4,12 @@ import { sessionGetJSON, sessionSetJSON, } from '@/utils/cache-session-utils'; +import { localGet } from '@/utils/cache-local-utils'; import { TOKEN_KEY, TOKEN_KEY_PREFIX } from '@/constants/token-constants'; -import { CACHE_SESSION_FATCH } from '@/constants/cache-keys-constants'; +import { + CACHE_LOCAL_I18N, + CACHE_SESSION_FATCH, +} from '@/constants/cache-keys-constants'; import { APP_REQUEST_HEADER_CODE, APP_REQUEST_HEADER_VERSION, @@ -92,6 +96,7 @@ const FATCH_OPTIONS: OptionsType = { headers: { [APP_REQUEST_HEADER_CODE]: import.meta.env.VITE_APP_CODE, [APP_REQUEST_HEADER_VERSION]: import.meta.env.VITE_APP_VERSION, + 'Accept-Language': `${localGet(CACHE_LOCAL_I18N)};q=0.9`, }, dataType: 'json', responseType: 'json',