send Accept-Language header
This commit is contained in:
parent
c61b047fed
commit
3c3e88b044
|
@ -3,6 +3,7 @@ import { Connection } from '../js/db/connection';
|
||||||
import { useUserStore } from 'stores/user';
|
import { useUserStore } from 'stores/user';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { useAppStore } from 'src/stores/app';
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
// Be careful when using SSR for cross-request state pollution
|
// Be careful when using SSR for cross-request state pollution
|
||||||
|
@ -37,9 +38,12 @@ const onResponseError = error => {
|
||||||
|
|
||||||
export default boot(({ app }) => {
|
export default boot(({ app }) => {
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const appStore = useAppStore();
|
||||||
|
console.log('appStore', appStore);
|
||||||
function addToken(config) {
|
function addToken(config) {
|
||||||
if (userStore.token) {
|
if (userStore.token) {
|
||||||
config.headers.Authorization = userStore.token;
|
config.headers.Authorization = userStore.token;
|
||||||
|
config.headers['Accept-Language'] = appStore.siteLang;
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue