perf: Optimize default language
This commit is contained in:
parent
ff5a866c37
commit
e308100169
@ -2,6 +2,7 @@
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import {getShareId, getShareToken, getToken, getUsername} from '@/utils/auth'
|
import {getShareId, getShareToken, getToken, getUsername} from '@/utils/auth'
|
||||||
|
import { getBrowserLanguage } from '@/utils/loadLocaleMessages';
|
||||||
|
|
||||||
// create an axios instance
|
// create an axios instance
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
@ -25,7 +26,7 @@ service.interceptors.request.use(
|
|||||||
config.headers['shareId'] = getShareId()
|
config.headers['shareId'] = getShareId()
|
||||||
}
|
}
|
||||||
// add i18n
|
// add i18n
|
||||||
config.headers['lang'] = store.getters.lang
|
config.headers['lang'] = store.getters.lang || getBrowserLanguage()
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user