|
|
@@ -174,7 +174,9 @@ const transform: AxiosTransform = {
|
|
|
*/
|
|
|
requestInterceptors: (config, options) => {
|
|
|
// 请求之前处理config
|
|
|
+ const { locale } = useI18n();
|
|
|
const token = getToken();
|
|
|
+ const lang = locale.value;
|
|
|
if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
|
|
|
// jwt token
|
|
|
// (config as Recordable).headers.Authorization = options.authenticationScheme
|
|
|
@@ -184,6 +186,9 @@ const transform: AxiosTransform = {
|
|
|
? `${options.authenticationScheme} ${token}`
|
|
|
: token;
|
|
|
}
|
|
|
+ if (lang && (config as Recordable)) {
|
|
|
+ (config as Recordable).headers.lang = lang == 'zh_CN' ? 'zh' : 'ja';
|
|
|
+ }
|
|
|
return config;
|
|
|
},
|
|
|
|