diff --git a/src/plugins/http-fetch.ts b/src/plugins/http-fetch.ts index 1eee7479..56379005 100644 --- a/src/plugins/http-fetch.ts +++ b/src/plugins/http-fetch.ts @@ -96,7 +96,6 @@ 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', @@ -121,11 +120,19 @@ function beforeRequest(options: OptionsType): OptionsType | Promise { ); } + // 客户端接受语言 + Reflect.set( + options.headers, + 'Accept-Language', + `${localGet(CACHE_LOCAL_I18N) || 'en_US'};q=0.9` + ); + // 是否需要设置 token const token = getToken(); if (options.whithToken && token) { Reflect.set(options.headers, TOKEN_KEY, TOKEN_KEY_PREFIX + token); } + // 是否需要防止数据重复提交 if ( options.repeatSubmit &&