forked from verdnatura/hedera-web
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 axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { useAppStore } from 'src/stores/app';
|
||||
|
||||
const { notify } = useNotify();
|
||||
// Be careful when using SSR for cross-request state pollution
|
||||
|
@ -37,9 +38,12 @@ const onResponseError = error => {
|
|||
|
||||
export default boot(({ app }) => {
|
||||
const userStore = useUserStore();
|
||||
const appStore = useAppStore();
|
||||
console.log('appStore', appStore);
|
||||
function addToken(config) {
|
||||
if (userStore.token) {
|
||||
config.headers.Authorization = userStore.token;
|
||||
config.headers['Accept-Language'] = appStore.siteLang;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue